diff options
| -rw-r--r-- | zenhttp/httpsys.cpp | 3 | ||||
| -rw-r--r-- | zenhttp/include/zenhttp/httpserver.h | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/zenhttp/httpsys.cpp b/zenhttp/httpsys.cpp index 2041be5c3..be538e7f7 100644 --- a/zenhttp/httpsys.cpp +++ b/zenhttp/httpsys.cpp @@ -906,6 +906,9 @@ HttpSysServerRequest::HttpSysServerRequest(HttpSysTransaction& Tx, HttpService& const HTTP_KNOWN_HEADER& CtHdr = HttpRequestPtr->Headers.KnownHeaders[HttpHeaderContentType]; m_ContentType = MapContentType({CtHdr.pRawValue, CtHdr.RawValueLength}); + + const HTTP_KNOWN_HEADER& AcceptHdr = HttpRequestPtr->Headers.KnownHeaders[HttpHeaderAccept]; + m_AcceptType = MapContentType({AcceptHdr.pRawValue, AcceptHdr.RawValueLength}); } void diff --git a/zenhttp/include/zenhttp/httpserver.h b/zenhttp/include/zenhttp/httpserver.h index d9637dff5..03695b1ce 100644 --- a/zenhttp/include/zenhttp/httpserver.h +++ b/zenhttp/include/zenhttp/httpserver.h @@ -206,6 +206,7 @@ public: inline HttpVerb RequestVerb() const { return m_Verb; } inline HttpContentType RequestContentType() { return m_ContentType; } + inline HttpContentType AcceptContentType() { return m_AcceptType; } const char* HeaderAccept() const; const char* HeaderAcceptEncoding() const; @@ -253,6 +254,7 @@ protected: HttpVerb m_Verb = HttpVerb::kGet; uint64_t m_ContentLength = ~0ull; HttpContentType m_ContentType = HttpContentType::kBinary; + HttpContentType m_AcceptType = HttpContentType::kUnknownContentType; ExtendableStringBuilder<256> m_UriUtf8; ExtendableStringBuilder<256> m_QueryStringUtf8; }; |