diff options
| author | Stefan Boberg <[email protected]> | 2023-04-24 15:48:55 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-04-24 15:48:55 +0200 |
| commit | 1a345a720f728438d0884c3ade4aa37d5c994701 (patch) | |
| tree | 8c06d8142b9774913c5de8a661080c25e1e74b6c /zenhttp/include | |
| parent | 0.2.5-pre4 (diff) | |
| download | zen-1a345a720f728438d0884c3ade4aa37d5c994701.tar.xz zen-1a345a720f728438d0884c3ade4aa37d5c994701.zip | |
fixed dashboard file serving bug (#255)
a recent change which introduced support for specifying accept: implicitly via the file extension in the URI caused fallout in the dashboard which would fail to serve any content because the extension was stripped from the RelativeUri accessor. This change fixes that by retaining a copy of the Uri string view which includes the suffix
additionally, in order to test this change with both asio/http.sys paths I made the path used for all tests configurable in zenserver-test which involved pulling in a change from sb/proto which makes testing configuration a bit more flexible
Diffstat (limited to 'zenhttp/include')
| -rw-r--r-- | zenhttp/include/zenhttp/httpserver.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/zenhttp/include/zenhttp/httpserver.h b/zenhttp/include/zenhttp/httpserver.h index 451a47b4a..3b9fa50b4 100644 --- a/zenhttp/include/zenhttp/httpserver.h +++ b/zenhttp/include/zenhttp/httpserver.h @@ -34,6 +34,7 @@ public: // Synchronous operations [[nodiscard]] inline std::string_view RelativeUri() const { return m_Uri; } // Returns URI without service prefix + [[nodiscard]] std::string_view RelativeUriWithExtension() const { return m_UriWithExtension; } [[nodiscard]] inline std::string_view QueryString() const { return m_QueryString; } struct QueryParams @@ -118,6 +119,7 @@ protected: HttpContentType m_AcceptType = HttpContentType::kUnknownContentType; uint64_t m_ContentLength = ~0ull; std::string_view m_Uri; + std::string_view m_UriWithExtension; std::string_view m_QueryString; mutable uint32_t m_RequestId = ~uint32_t(0); mutable Oid m_SessionId = Oid::Zero; |