aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2023-04-26 14:43:55 +0200
committerGitHub <[email protected]>2023-04-26 14:43:55 +0200
commit363e0f92c2c29c18dc45a3889c2f5ee182d14fa2 (patch)
tree22bbbb35d271061090f3e9ea75fb1d71f8fb82f5
parent0.2.6 (diff)
downloadzen-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.md3
-rw-r--r--zenhttp/httpsys.cpp5
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