Skip to content

Commit

Permalink
Queries must have =
Browse files Browse the repository at this point in the history
  • Loading branch information
uNetworkingAB committed Apr 30, 2023
1 parent a658d16 commit c3fa05b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/QueryParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace uWS {
if (statement.length() && statement[0] == key[0]) {
/* Equal sign must be present and not in the end of statement */
auto equality = statement.find('=');
if (/*equality != std::string_view::npos && equality != statement.length() - 1*/ true) {
if (equality != std::string_view::npos) {

std::string_view statementKey = statement.substr(0, equality);
std::string_view statementValue = statement.substr(equality + 1);
Expand Down Expand Up @@ -104,15 +104,15 @@ namespace uWS {
}
} else {
/* This querystring is invalid, cannot parse it */
return {};
return {nullptr, 0};
}
}

queryString.remove_prefix(statement.length() + 1);
}

/* Nothing found */
return {};
/* Nothing found is given as nullptr, while empty string is given as some pointer to the given buffer */
return {nullptr, 0};
}

}
Expand Down

0 comments on commit c3fa05b

Please sign in to comment.