Overview
Comment: | OFHTTPClient: Fix wrong Host on redirect
The Host was still pointing to the old Host on a redirect to a different |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
412c005e2b775e9ad3e8ef0189a33e0c |
User & Date: | js on 2016-07-10 15:51:39 |
Other Links: | manifest | tags |
Context
2016-07-10
| ||
16:23 | runtime/exception.m: abort() -> OBJC_ERROR() check-in: 85a52c4717 user: js tags: trunk | |
15:51 | OFHTTPClient: Fix wrong Host on redirect check-in: 412c005e2b user: js tags: trunk | |
2016-07-09
| ||
20:10 | Update buildsys check-in: 4b40a883d2 user: js tags: trunk | |
Changes
Modified src/OFHTTPClient.m from [382795589b] to [01bffed1c2].
︙ | ︙ | |||
643 644 645 646 647 648 649 | else if (status == 303) follow = true; else follow = false; } if (follow) { | | > > > | < | < < < | | | | | < > > > | 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 | else if (status == 303) follow = true; else follow = false; } if (follow) { OFHTTPRequest *newRequest = [[request copy] autorelease]; OFMutableDictionary *newHeaders = [[headers mutableCopy] autorelease]; if (![[newURL host] isEqual: [URL host]]) [newHeaders removeObjectForKey: @"Host"]; /* * 303 means the request should be converted to a GET * request before redirection. This also means stripping * the entity of the request. */ if (status == 303) { OFEnumerator *keyEnumerator, *objectEnumerator; id key, object; keyEnumerator = [headers keyEnumerator]; objectEnumerator = [headers objectEnumerator]; while ((key = [keyEnumerator nextObject]) != nil && (object = [objectEnumerator nextObject]) != nil) if ([key hasPrefix: @"Content-"]) [newHeaders removeObjectForKey: key]; [newRequest setMethod: OF_HTTP_REQUEST_METHOD_GET]; [newRequest setBody: nil]; } [newRequest setURL: newURL]; [newRequest setHeaders: newHeaders]; [newRequest retain]; objc_autoreleasePoolPop(pool); [newRequest autorelease]; return [self performRequest: newRequest redirects: redirects - 1]; } |
︙ | ︙ |