I'm aware that HTTP servers can send headers with duplicate keys (at least Set-Cookie
comes to mind), but is there a plausible reason for clients to do this?
相关问题
- Angular RxJS mergeMap types
- Google Apps Script: testing doPost() with cURL
- How to instantiate Http service in main.ts manuall
- C#使用http访问网络,有办法用指定网卡访问网络嘛?
- PHP Empty $_POST
相关文章
- C#使用http访问网络,有办法用指定网卡访问网络嘛?
- Is a unicode user agent legal inside an HTTP heade
- git: retry if http request failed
- Flutter - http.get fails on macos build target: Co
- C# HttpClient.SendAsync always returns 404 but URL
- Response body is null, status is 200
- Returning plain text or other arbitary file in ASP
- jquery how to get the status message returned by a
RFC 7230 does allow for duplicate headers under some circumstances. From section 3.2.2:
One somewhat "plausible" scenario comes to mind: When the HTTP request is passing through a proxy, the proxy might simply tack on another header (say, an
X-Forwarded-For
, or an extraAccept-Encoding
), rather than determine if a header already exists, then parse and modify it accordingly.Technically, any client is "allowed" to send multiple headers with the same name, so long as it meets the requirements in RFC 7230 above.
a) It might be easier when multiple pieces of code are involved,
b) It can be unavoidable for certain fields such as Set-Cookie (see https://greenbytes.de/tech/webdav/rfc7230.html#rfc.section.3.2.2.p.4).