NSURLSession should pass its additional headers to NSURLProtocol
Originator: | nicolas.bouilleaud | ||
Number: | rdar://17809816 | Date Originated: | 2014-09-30 |
Status: | Open | Resolved: | |
Product: | iOS SDK | Product Version: | 8.0 |
Classification: | Serious Bug | Reproducible: | Always |
Summary: When adding `HTTPAdditionalHeaders` to an `NSURLSession` and setting it up with an `NSURLProtocol`, the request seen by `NSURLProtocol` should contain all the HTTP headers, including the ones from HTTPAdditionalHeaders. Steps to Reproduce: See attached minimal project. We configure an NSURLSession with an additional HTTP Header, and set it up with an NSURLProtocol. Expected Results: In the protocol’s `startLoading` method, `self.request.allHTTPHeaderFields` should contain both the headers added to this specific request, and the additional headers setup on the session Actual Results: In iOS8, this isn't the case. Only the request-specific headers are present. Version: Xcode 6b4 (6A267n) Notes: In iOS7, this worked correctly. Configuration: iPhone 4S Simulator 8.0 (12A4331d) Attachments: 'TestAllHTTPHeaders.zip' was successfully uploaded. See -> http://cl.ly/3a0Q1k083V0z/download/TestAllHTTPHeaders.zip
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!