diff options
| author | Dan Engelbrecht <[email protected]> | 2023-04-26 14:43:55 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-04-26 14:43:55 +0200 |
| commit | 363e0f92c2c29c18dc45a3889c2f5ee182d14fa2 (patch) | |
| tree | 22bbbb35d271061090f3e9ea75fb1d71f8fb82f5 | |
| parent | 0.2.6 (diff) | |
| download | zen-363e0f92c2c29c18dc45a3889c2f5ee182d14fa2.tar.xz zen-363e0f92c2c29c18dc45a3889c2f5ee182d14fa2.zip | |
only strip accept type suffix if it can be parsed to a known type (#258)
* only strip accept type suffix if it can be parsed to a known type
* changelog
| -rw-r--r-- | CHANGELOG.md | 3 | ||||
| -rw-r--r-- | zenhttp/httpsys.cpp | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d321c1a9..7c2eaeb5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ ## +- Bugfix: only strip uri accept type suffix if it can be parsed to a known type + +## 0.2.6 - Strip __FILE__ macro names in logging to only include the file name as to not expose file paths of the machine building the executable - Bugfix: Reporting the correct callstack to sentry on ERROR/CRITICAL failure. - Extend sentry message with triggering file/line/function diff --git a/zenhttp/httpsys.cpp b/zenhttp/httpsys.cpp index 0f4fe0a6d..c733d618d 100644 --- a/zenhttp/httpsys.cpp +++ b/zenhttp/httpsys.cpp @@ -1247,9 +1247,12 @@ HttpSysServerRequest::HttpSysServerRequest(HttpSysTransaction& Tx, HttpService& if (LastDotIndex != std::string_view::npos) { UriSuffix8.remove_prefix(LastDotIndex + 1); - m_Uri.remove_suffix(UriSuffix8.size() + 1); AcceptContentType = ParseContentType(UriSuffix8); + if (AcceptContentType != HttpContentType::kUnknownContentType) + { + m_Uri.remove_suffix(UriSuffix8.size() + 1); + } } } else |