mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Fix error with Location header
This commit is contained in:
parent
bc285396da
commit
f170693bca
2 changed files with 14 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
2017-08-21 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSURLProtocol.m: Fixed error where the presence of a
|
||||
Location error was taken to indicate a redirect rather than looking
|
||||
at the HTTP status code for a 3xx value.
|
||||
|
||||
2017-07-10 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Source/GSString.m (lengthUTF8):
|
||||
|
|
|
@ -1051,11 +1051,17 @@ static NSURLProtocol *placeholder = nil;
|
|||
* until the challenge is complete, then try to deal with it.
|
||||
*/
|
||||
}
|
||||
else if ((s = [[document headerNamed: @"location"] value]) != nil)
|
||||
else if (_statusCode >= 300 && _statusCode < 400)
|
||||
{
|
||||
NSURL *url;
|
||||
|
||||
url = [NSURL URLWithString: s];
|
||||
NS_DURING
|
||||
s = [[document headerNamed: @"location"] value];
|
||||
url = [NSURL URLWithString: s];
|
||||
NS_HANDLER
|
||||
url = nil;
|
||||
NS_ENDHANDLER
|
||||
|
||||
if (url == nil)
|
||||
{
|
||||
NSError *e;
|
||||
|
|
Loading…
Reference in a new issue