Commit 148d726c authored by jan.koester's avatar jan.koester
Browse files

test

parent ad296e35
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -4292,6 +4292,17 @@ size_t libhttppp::HttpRequest::parseH1() {
      return 0;
    }

    // 1b) Discard whatever header state a *previous* request on this same keep-alive
    // connection left behind. The per-line loop below deliberately does getHeaderData()
    // before setHeaderData() (see its own comment) so that a header genuinely repeated
    // within *this* request's raw bytes (e.g. multiple Cookie: lines) appends rather than
    // clobbers -- but that same lookup can't distinguish "seen earlier in this request" from
    // "left over from the request before it" on a reused connection. Without this, every
    // single-value header (User-Agent, Accept, Referer, ...) silently accumulates one more
    // stale value per request handled on the connection, until a strict backend (observed
    // live: Home Assistant's aiohttp) rejects it outright as a duplicate header.
    HttpHeader::clear();

    // 2) Copy header bytes (include the first \r\n of the separator so
    //    every header line, including the last one, ends with \r\n)
    header.assign(RecvData.begin(), RecvData.begin() + endpos + 2);