Skip to content

Commit

Permalink
Fix: clear last queries and check upgrade (#579)
Browse files Browse the repository at this point in the history
  • Loading branch information
qicosmos authored May 9, 2024
1 parent d380021 commit 7f645b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions include/cinatra/http_parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ class http_parser {
}

full_url_ = url_;
if (!queries_.empty()) {
queries_.clear();
}
if (has_query) {
size_t pos = url_.find('?');
parse_query(url_.substr(pos + 1, url_len - pos - 1));
Expand Down
2 changes: 1 addition & 1 deletion include/cinatra/picohttpparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ static const char *parse_headers(const char *buf, const char *buf_end,
// has connection
has_connection = true;
char ch = *value;
if (ch == 'U') {
if (ch == 'U' || ch == 'u') {
// has upgrade
has_upgrade = true;
}
Expand Down

0 comments on commit 7f645b7

Please sign in to comment.