Squid-2.2.STABLE2: Support multiline headers HTTP allows request/response headers to be broken up into multiple lines. Squid only parsed the first line, ignoring any continuation lines. Index: squid/src/HttpHeader.c diff -u squid/src/HttpHeader.c:1.1.1.12 squid/src/HttpHeader.c:1.1.1.12.8.1 --- squid/src/HttpHeader.c:1.1.1.12 Sun Feb 14 23:29:49 1999 +++ squid/src/HttpHeader.c Mon May 3 21:13:49 1999 @@ -383,9 +383,22 @@ HttpHeaderStats[hdr->owner].parsedCount++; /* commonn format headers are ":[ws]" lines delimited by */ while (field_start < header_end) { - const char *field_end = field_start + strcspn(field_start, "\r\n"); + const char *field_end = field_start; + do { + field_end = field_end + strcspn(field_end, "\r\n"); + /* skip CRLF */ + if (*field_end == '\r') + field_end++; + if (*field_end == '\n') + field_end++; + } while (*field_end == ' ' || *field_end == '\t'); if (!*field_end || field_end > header_end) return httpHeaderReset(hdr); /* missing */ + /* back up over CRLF */ + if (field_end > field_start && field_end[-1] == '\n') + field_end--; + if (field_end > field_start && field_end[-1] == '\r') + field_end--; e = httpHeaderEntryParseCreate(field_start, field_end); if (e != NULL) httpHeaderAddEntry(hdr, e);