Loading src/http.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -4239,6 +4239,17 @@ const std::string & libhttppp::HttpRequest::getRequestVersion(){ return _cachedRequestVersion; } const std::string &libhttppp::HttpRequest::getHost(){ if(_cachedHost.empty()){ auto *hHost = getHeaderData("host"); if(!hHost) hHost = getHeaderData(":authority"); if(hHost && hHost->getfirstValue()) _cachedHost = hHost->getfirstValue()->getvalue(); } return _cachedHost; } size_t libhttppp::HttpRequest::getContentLength(){ HttpHeader::HeaderData *clen=getHeaderData("content-length"); if(!clen) Loading src/http.h +2 −0 Original line number Diff line number Diff line Loading @@ -329,6 +329,7 @@ namespace libhttppp { const std::string &getRequest(); size_t getRequestLength(); const std::string &getRequestVersion(); const std::string &getHost(); size_t getContentLength(); size_t getMaxUploadSize(); Loading Loading @@ -362,6 +363,7 @@ namespace libhttppp { mutable std::string _cachedRequestURL; mutable std::string _cachedRequest; mutable std::string _cachedRequestVersion; mutable std::string _cachedHost; // HTTP/2 and HTTP/3 protocol state (managed by HttpEvent). // All H2-specific mutable state lives in a heap-allocated struct so Loading Loading
src/http.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -4239,6 +4239,17 @@ const std::string & libhttppp::HttpRequest::getRequestVersion(){ return _cachedRequestVersion; } const std::string &libhttppp::HttpRequest::getHost(){ if(_cachedHost.empty()){ auto *hHost = getHeaderData("host"); if(!hHost) hHost = getHeaderData(":authority"); if(hHost && hHost->getfirstValue()) _cachedHost = hHost->getfirstValue()->getvalue(); } return _cachedHost; } size_t libhttppp::HttpRequest::getContentLength(){ HttpHeader::HeaderData *clen=getHeaderData("content-length"); if(!clen) Loading
src/http.h +2 −0 Original line number Diff line number Diff line Loading @@ -329,6 +329,7 @@ namespace libhttppp { const std::string &getRequest(); size_t getRequestLength(); const std::string &getRequestVersion(); const std::string &getHost(); size_t getContentLength(); size_t getMaxUploadSize(); Loading Loading @@ -362,6 +363,7 @@ namespace libhttppp { mutable std::string _cachedRequestURL; mutable std::string _cachedRequest; mutable std::string _cachedRequestVersion; mutable std::string _cachedHost; // HTTP/2 and HTTP/3 protocol state (managed by HttpEvent). // All H2-specific mutable state lives in a heap-allocated struct so Loading