Skip to content

Commit

Permalink
Make sure query value is not repeated from previous web request
Browse files Browse the repository at this point in the history
  • Loading branch information
sebaszm authored and pwielders committed Feb 2, 2021
1 parent 7ce0ff6 commit 071c003
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions Source/core/Optional.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ namespace Core {
inline void Clear()
{
m_Set = false;
m_Value = TYPE{};
}

operator TYPE&()
Expand Down
4 changes: 4 additions & 0 deletions Source/websocket/WebSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1349,12 +1349,16 @@ namespace Web

if ((query == string::npos) && (fragment == string::npos)) {
_current->Path = buffer;
_current->Query.Clear();
_current->Fragment.Clear();
} else if (fragment == string::npos) {
_current->Path = buffer.substr(0, query);
_current->Query = buffer.substr(query + 1, buffer.size() - query);
_current->Fragment.Clear();
} else if (query == string::npos) {
_current->Path = buffer.substr(0, fragment);
_current->Fragment = buffer.substr(fragment + 1, buffer.size() - fragment);
_current->Query.Clear();
} else if (query < fragment) {
_current->Path = buffer.substr(0, query);
_current->Query = buffer.substr(query + 1, buffer.size() - query);
Expand Down

0 comments on commit 071c003

Please sign in to comment.