Conversation
Client can send header values with CRLF, trailing whitespace or just empty.
|
The invalid header value is actually stripped by HTTPRequest, not by URLSession. One test we could do is whether multi-value fields are preserved, but URLSession won't pass it today. |
PTAL at the new multi-value tests, URLSession seems to pass those fine? |
…new-tests # Conflicts: # Sources/HTTPClientConformance/HTTPClientConformance.swift
Given our conversation above, merging multi-value fields is an optional feature that our tests allow, because some clients may choose to do so. Later on when we write tests for cookies, we can also ensure that this merging does not apply to |
Motivation
Improve conformance coverage for uncommon header values and infinite HTTP redirection taking inspiration from existing tests and HTTP RFC specs.
Modifications
Added 5 tests:
Content-Length(RFC 9112 §6.3, rule 1)Result
These tests pass with the URLSession implementation of HTTPClient.
Test Plan
Manually verified some of this behavior with
curl.