mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Don't expect body where status is 204 or 304
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20224 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c2ed783573
commit
904b153302
2 changed files with 15 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
2004-10-15 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/GSHTTPURLHandle.m: Don't expect a baody where status is 204
|
||||
or 304
|
||||
|
||||
2004-10-13 Adam Fedor <fedor@gnu.org>
|
||||
|
||||
* Source/NSBundle.m (_bundle_name_first_match): Remove path
|
||||
|
|
|
@ -426,11 +426,15 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data)
|
|||
|
||||
if (complete == NO && [parser isInHeaders] == NO)
|
||||
{
|
||||
GSMimeHeader *info;
|
||||
NSString *enc;
|
||||
NSString *len;
|
||||
NSString *status;
|
||||
float ver;
|
||||
|
||||
ver = [[[document headerNamed: @"http"] value] floatValue];
|
||||
info = [document headerNamed: @"http"];
|
||||
ver = [[info value] floatValue];
|
||||
status = [info objectForKey: NSHTTPPropertyStatusCodeKey];
|
||||
len = [[document headerNamed: @"content-length"] value];
|
||||
enc = [[document headerNamed: @"content-transfer-encoding"] value];
|
||||
if (enc == nil)
|
||||
|
@ -438,7 +442,11 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data)
|
|||
enc = [[document headerNamed: @"transfer-encoding"] value];
|
||||
}
|
||||
|
||||
if ([enc isEqualToString: @"chunked"] == YES)
|
||||
if ([status isEqual: @"204"] || [status isEqual: @"304"])
|
||||
{
|
||||
complete = YES; // No body expected.
|
||||
}
|
||||
else if ([enc isEqualToString: @"chunked"] == YES)
|
||||
{
|
||||
complete = NO; // Read chunked body data
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue