Commit b8559cba authored by jan.koester's avatar jan.koester
Browse files

test

parent 16335762
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -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)
+2 −0
Original line number Diff line number Diff line
@@ -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();

@@ -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