[Breaking Change Request] Allow http implementation to work with case-sensitive Http Headers #41628
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
breaking-change-request
This tracks requests for feedback on breaking changes
library-_http
Context
This is a follow-up for #39657. Class
HttpHeaders
allows case-sensitive header fields. However, there are multiple places in our Http implementation which force headers as lowercased. It blocked headers sent/received being case-sensitive.The intended change in behavior
_HttpParser
allows HttpHeaders field to be whatever it is instead of parsing it to lowercased field. That makes sure all incoming requests/responses have their headers fields unchanged._HttpHeaders
's_build()
will no longer use lowercased field name to generate outgoing headers.Expected impact
Code that use
HttpClient
andHttpServer
are affected.Breakage:
request.headers
will now have "CapitalizedHeaders" as a key instead of "capitalizedheaders". Potentially, checks likeheaders['capitalizedheaders'] != null
will fail.HttpClientResponse
will also be able to capture that.Steps for mitigation
When doing a look up in
headers
or a string comparison forheaders
's field, use case-sensitive string.Proposed implementation
https://dart-review.googlesource.com/c/sdk/+/143081
The text was updated successfully, but these errors were encountered: