Doug Reese
2016-08-31 09:08:29 UTC
Hi,
I'm using the dart:io HttpClient to communicate with an API that is not
under my control. This API incorrectly requires case sensitive header
field names, such as:
Authorization: Basic xxxyyyzzz
The HttpClientRequest header gets sent as:
authorization: Basic xxxyyyzzz
which is technically correct (according to RFC 7230 section 3.2*), but does
not work against this API. I have asked for the API to be fixed, however
this is for a very vertical market application that is installed in
customer sites. Even if the API is fixed, I do not yet know how often
customer sites are updated.
I have looked at the HttpHeader code, and the lowercasing of the field name
is really baked in. In reading the RFC*, I can interpret it to mean the
case of the field name could (should?) be completely ignored by the client,
with all the adjustment to lowercase happening on the server for the
purposes of comparison. According to the spec, it seems I should be able
to send "AuThOrIzAtIoN" and expect it to be matched to "authorization" on
the server.
Any thoughts on removing the "force to lowercase" of header field names? I
realize this would require a change in how the HttpHeader class ensures
there are no duplicate header field names as well (section 3.2.2 of the
RFC).
In the short term, any suggestions as to how I might support an API that
incorrectly requires the field name to have an uppercase first letter?
Since I cannot authenticate properly this project is dead in the water
right now.
Thanks.
Doug
* https://tools.ietf.org/html/rfc7230#section-3.2
3.2 <https://tools.ietf.org/html/rfc7230#section-3.2>. Header Fields
Each header field consists of a case-insensitive field name followed
by a colon (":"), optional leading whitespace, the field value, and
optional trailing whitespace.
I'm using the dart:io HttpClient to communicate with an API that is not
under my control. This API incorrectly requires case sensitive header
field names, such as:
Authorization: Basic xxxyyyzzz
The HttpClientRequest header gets sent as:
authorization: Basic xxxyyyzzz
which is technically correct (according to RFC 7230 section 3.2*), but does
not work against this API. I have asked for the API to be fixed, however
this is for a very vertical market application that is installed in
customer sites. Even if the API is fixed, I do not yet know how often
customer sites are updated.
I have looked at the HttpHeader code, and the lowercasing of the field name
is really baked in. In reading the RFC*, I can interpret it to mean the
case of the field name could (should?) be completely ignored by the client,
with all the adjustment to lowercase happening on the server for the
purposes of comparison. According to the spec, it seems I should be able
to send "AuThOrIzAtIoN" and expect it to be matched to "authorization" on
the server.
Any thoughts on removing the "force to lowercase" of header field names? I
realize this would require a change in how the HttpHeader class ensures
there are no duplicate header field names as well (section 3.2.2 of the
RFC).
In the short term, any suggestions as to how I might support an API that
incorrectly requires the field name to have an uppercase first letter?
Since I cannot authenticate properly this project is dead in the water
right now.
Thanks.
Doug
* https://tools.ietf.org/html/rfc7230#section-3.2
3.2 <https://tools.ietf.org/html/rfc7230#section-3.2>. Header Fields
Each header field consists of a case-insensitive field name followed
by a colon (":"), optional leading whitespace, the field value, and
optional trailing whitespace.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.