MKNetworkKit
MKNetworkKit copied to clipboard
Made the HTTP header matching case insensitive
I've noticed that some servers return ETag headers with name "Etag," "ETag," "ETAG", etc. all of which do not get matched by NSDictionary's "objectForKey" method, which is case sensitive. HTTP header names are case insensitive. This commit allows case insensitive matching.
according to rfc correct spelling is "ETag". If a server doesn't spell it correctly- it's a server problem.
If a server doesn't spell it correctly- it's a server problem.
Ran across this on google and just wanted to note for future visitors that the casing should make NO difference. Headers are case-insensitive as per RFC 2616 Section 4.2. etag, ETag, ETAG, eTaG ... they should all be accepted and usable by any application/server that purports to be HTTP/1.1 compliant.
So if it's not spelled correctly it's a "server problem." But if it's not capitalized in your specific way it's a "you problem" and the casing should be normalized before use.
my bad( You are right, @rdlowrey!