Skip to content

Instantly share code, notes, and snippets.

@myronmarston
Created July 16, 2011 23:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save myronmarston/1086910 to your computer and use it in GitHub Desktop.
Save myronmarston/1086910 to your computer and use it in GitHub Desktop.
Demonstration of ETag header casing issue
require 'rack'
run lambda { |env|
[
200,
{ 'ETag' => 'some etag value', 'Content-Type' => 'text/plain' },
['ETag has been set']
]
}
curl -is http://localhost:9292/
HTTP/1.1 200 OK
Etag: some etag value
Connection: Keep-Alive
Content-Type: text/plain
Date: Sat, 16 Jul 2011 23:17:23 GMT
Server: WEBrick/1.3.1 (Ruby/1.8.7/2011-02-18)
Content-Length: 17
ETag has been set
@myronmarston
Copy link
Author

Notice that the header is set as "ETag" but rack normalizes it to "Etag".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment