From 363e0f92c2c29c18dc45a3889c2f5ee182d14fa2 Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Wed, 26 Apr 2023 14:43:55 +0200 Subject: 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 --- CHANGELOG.md | 3 +++ zenhttp/httpsys.cpp | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3