diff options
| author | Joel Klinghed <the_jk@spawned.biz> | 2025-10-20 22:01:29 +0200 |
|---|---|---|
| committer | Joel Klinghed <the_jk@spawned.biz> | 2025-10-21 23:15:29 +0200 |
| commit | d469db4fece0afb62ba58359d265a56712d5db64 (patch) | |
| tree | 605ea0f4b454d13f3104025c3d6d71c0a37b08ff /src | |
| parent | 4dddfd622977f84f0cf41847aec9e728d02bec65 (diff) | |
http: Do not include query in path
No handler currently care about query, so they should be ignored.
Diffstat (limited to 'src')
| -rw-r--r-- | src/http.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/http.cc b/src/http.cc index c88aa6d..4204dcb 100644 --- a/src/http.cc +++ b/src/http.cc @@ -752,6 +752,9 @@ class ServerImpl : public Server { close_client(client_id); return false; } + size_t query = path.find('?'); + if (query != std::string_view::npos) + path = path.substr(0, query); } for (size_t i = 1; i < lines.size(); ++i) { auto colon = lines[i].find(':'); |
