<b id="internal-source-marker_0.6658254852518439" style="color:rgb(0,0,0);font-family:Times;font-size:medium;font-weight:normal"><span style="font-size:15px;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">At the moment our Android library is sensitive to response header cases. What that means is that if a web server returns auth-token: xxxx-xxxx instead of Auth-Token: xxxx-xxxx our RestAuthenticationModule fails to find the token.</span><br>
<span style="font-size:15px;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap"></span><br><span style="font-size:15px;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">I found this interesting issue on the topic: </span><a href="https://github.com/joyent/node/issues/1954"><span style="font-size:15px;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">https://github.com/joyent/node/issues/1954</span></a><span style="font-size:15px;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap"></span><br>
<span style="font-size:15px;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">HTTP Spec indeed says that headers are case-insensitive. But the whole world seems to go towards a more practical approach of case sensitivity, as it’s simpler to lookup headers that way.</span><br>
<br><span style="font-size:15px;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Incidentally, I discovered this while using an integration testing module I’ve been working on: <a href="https://github.com/mstruk/exploratorium-android-rest">https://github.com/mstruk/exploratorium-android-rest</a> (it&#39;s a work in progress).</span><br>
<span style="font-size:15px;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap"></span><br><span style="font-size:15px;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">The rationale is that really testing the code means going through as much of a real runtime as possible - like using Arquillian ... </span><br>
<span style="font-size:15px;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap"></span><br><span style="font-size:15px;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">At first I thought it was HttpClient, and HttpURLConnection APIs lowercasing the headers. Turned out it was the embedded HTTP server.</span><br>
<span style="font-size:15px;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap"></span><br><span style="font-size:15px;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">The question in this case is do we call this an issue or is this something we don’t care about.</span></b><div>
<b style="color:rgb(0,0,0);font-weight:normal"><font face="Arial"><span style="font-size:15.454545021057129px;white-space:pre-wrap"><br></span></font></b></div><div><b style="color:rgb(0,0,0);font-weight:normal"><font face="Arial"><span style="font-size:15.454545021057129px;white-space:pre-wrap">- marko<br>
</span></font><br></b></div>