mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
set content length header if not already set
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35825 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
86e6ebe7e7
commit
eba1a7be03
3 changed files with 17 additions and 6 deletions
|
@ -404,11 +404,16 @@ debugWrite(GSHTTPURLHandle *handle, NSData *data)
|
|||
}
|
||||
}
|
||||
|
||||
if ([wData length] > 0)
|
||||
/* Ensure we set the correct content length (may be zero)
|
||||
*/
|
||||
if ((id)NSMapGet(wProperties, (void*)@"Content-Length") == nil)
|
||||
{
|
||||
NSMapInsert(wProperties, (void*)@"Content-Length",
|
||||
(void*)[NSString stringWithFormat: @"%d", [wData length]]);
|
||||
(void*)[NSString stringWithFormat: @"%d", [wData length]]);
|
||||
}
|
||||
|
||||
if ([wData length] > 0)
|
||||
{
|
||||
/*
|
||||
* Assume content type if not specified.
|
||||
*/
|
||||
|
@ -418,6 +423,7 @@ debugWrite(GSHTTPURLHandle *handle, NSData *data)
|
|||
(void*)@"application/x-www-form-urlencoded");
|
||||
}
|
||||
}
|
||||
|
||||
if ((id)NSMapGet(wProperties, (void*)@"Authorization") == nil)
|
||||
{
|
||||
NSURLProtectionSpace *space;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue