• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
HTTP extensions to NSMutableURLRequest erroneously modify headers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

HTTP extensions to NSMutableURLRequest erroneously modify headers


  • Subject: HTTP extensions to NSMutableURLRequest erroneously modify headers
  • From: email@hidden
  • Date: Tue, 26 Jul 2005 01:13:51 +1000

The setValue:forHTTPHeaderField: method provided by the NSMutableHTTPURLRequest category of NSMutableURLRequest automatically converts the header names to titlecase, e.g. "sample-value" becomes "Sample-value". I don't much care about the validity of this from the point of view of the HTTP protocol - I'm working with BitTorrent trackers, and they are case sensitive, expecting lowercase header names. Is there any way I can work around this? Since this is added in a category - and the capitalisation is being performed by the category method, looking at the disassembly - I'm not sure how I can override it.... I guess I'll have to override something further along in the request process, to restore the header names to the original values. Any thoughts?

I've tried poking around with NSHTTPURLProtocol, where the headers are ultimately stored, but I'm missing a piece of the puzzle... while header values are set via the setProperty:forKey:inRequest: class method (with the header name as the key), this isn't enough to have the original NSMutableHTTPURLRequest notice them... there's some other storage somewhere I've missed.

Wade Tregaskis (AIM/iChat, Yahoo & Skype: wadetregaskis, ICQ: 40056898, MSN: email@hidden, AV iChat & email: email@hidden, Jabber: email@hidden)
-- Sed quis custodiet ipsos custodes?


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: HTTP extensions to NSMutableURLRequest erroneously modify headers
      • From: email@hidden
  • Prev by Date: Re: smooth QT loop (in OpenGL texture context)
  • Next by Date: Re: Handling two or more nib files
  • Previous by thread: Re: HTML rendering on 10.3 vs 10.4
  • Next by thread: Re: HTTP extensions to NSMutableURLRequest erroneously modify headers
  • Index(es):
    • Date
    • Thread