diff options
| author | Stefan Boberg <[email protected]> | 2023-04-24 15:53:30 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2023-04-24 15:53:30 +0200 |
| commit | 9ee1a686c29b7ab18207c2963497337532f441cb (patch) | |
| tree | 17d2681767e92603b7199d88235a775e5ca354ab /zenhttp/httpsys.cpp | |
| parent | added changelog comment (diff) | |
| parent | fixed dashboard file serving bug (#255) (diff) | |
| download | zen-9ee1a686c29b7ab18207c2963497337532f441cb.tar.xz zen-9ee1a686c29b7ab18207c2963497337532f441cb.zip | |
Merge branch 'main' of https://github.com/EpicGames/zen
Diffstat (limited to 'zenhttp/httpsys.cpp')
| -rw-r--r-- | zenhttp/httpsys.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/zenhttp/httpsys.cpp b/zenhttp/httpsys.cpp index 16ec135cd..0f4fe0a6d 100644 --- a/zenhttp/httpsys.cpp +++ b/zenhttp/httpsys.cpp @@ -1232,6 +1232,9 @@ HttpSysServerRequest::HttpSysServerRequest(HttpSysTransaction& Tx, HttpService& std::string_view UriSuffix8{m_UriUtf8}; + m_UriWithExtension = UriSuffix8; // Retain URI with extension for user access + m_Uri = UriSuffix8; + const size_t LastComponentIndex = UriSuffix8.find_last_of('/'); if (LastComponentIndex != std::string_view::npos) @@ -1244,22 +1247,18 @@ 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_UriUtf8.RemoveSuffix((uint32_t)(UriSuffix8.size() + 1)); - } } } else { m_UriUtf8.Reset(); + m_Uri = {}; + m_UriWithExtension = {}; } - m_Uri = std::string_view(m_UriUtf8); - if (uint16_t QueryStringLength = HttpRequestPtr->CookedUrl.QueryStringLength) { --QueryStringLength; // We skip the leading question mark |