File tree Expand file tree Collapse file tree 5 files changed +24
-3
lines changed
Expand file tree Collapse file tree 5 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 1+ 2023-01-13 Frederik Seiffert <frederik@algoriddim.com>
2+
3+ * Source/Additions/GSInsensitiveDictionary.m:
4+ * Source/NSURLRequest.m:
5+ * Source/NSURLResponse.m:
6+ Fix NSURLSession header fields not always being matched case
7+ insensitive.
8+
192023-01-13 Frederik Seiffert <frederik@algoriddim.com>
210
311 * Source/GSEasyHandle.m:
Original file line number Diff line number Diff line change @@ -378,6 +378,13 @@ - (id) copyWithZone: (NSZone*)zone
378378 return [copy initWithDictionary: self copyItems: NO ];
379379}
380380
381+ - (id ) mutableCopyWithZone : (NSZone *)z
382+ {
383+ NSMutableDictionary *copy = [_GSMutableInsensitiveDictionary allocWithZone: z];
384+
385+ return [copy initWithDictionary: self copyItems: NO ];
386+ }
387+
381388- (id ) init
382389{
383390 return [self initWithCapacity: 0 ];
Original file line number Diff line number Diff line change @@ -3345,7 +3345,6 @@ - (BOOL) _scanHeaderParameters: (NSScanner*)scanner into: (GSMimeHeader*)info
33453345
33463346@end
33473347
3348-
33493348
33503349@interface _GSMutableInsensitiveDictionary : NSMutableDictionary
33513350@end
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ - (id) copyWithZone: (NSZone*)z
118118 inst->shouldHandleCookies = this->shouldHandleCookies ;
119119 inst->debug = this->debug ;
120120 inst->ioDelegate = this->ioDelegate ;
121- inst->headers = [this->headers mutableCopy ];
121+ inst->headers = [this->headers mutableCopy ];
122122 }
123123 }
124124 return o;
Original file line number Diff line number Diff line change @@ -284,8 +284,15 @@ - (id) initWithURL: (NSURL*)URL
284284 textEncodingName: nil ];
285285 if (nil != self)
286286 {
287+ NSString *k;
288+ NSEnumerator *e = [headerFields keyEnumerator ];
289+ while (nil != (k = [e nextObject ]))
290+ {
291+ NSString *v = [headerFields objectForKey: k];
292+ [self _setValue: v forHTTPHeaderField: k];
293+ }
294+
287295 this->statusCode = statusCode;
288- this->headers = [headerFields copy ];
289296 [self _checkHeaders ];
290297 }
291298 return self;
You can’t perform that action at this time.
0 commit comments