mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
Fix minor error setting host header in request.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28404 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
abc61b49c3
commit
3bf7a26b78
3 changed files with 37 additions and 2 deletions
|
@ -424,7 +424,22 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data)
|
|||
|
||||
if ((id)NSMapGet(wProperties, (void*)@"Host") == nil)
|
||||
{
|
||||
NSMapInsert(wProperties, (void*)@"Host", (void*)[u host]);
|
||||
id p = [u port];
|
||||
id h = [u host];
|
||||
|
||||
if (h == nil)
|
||||
{
|
||||
h = @""; // Must use an empty host header
|
||||
}
|
||||
if (p == nil)
|
||||
{
|
||||
NSMapInsert(wProperties, (void*)@"Host", (void*)h);
|
||||
}
|
||||
else
|
||||
{
|
||||
NSMapInsert(wProperties, (void*)@"Host",
|
||||
(void*)[NSString stringWithFormat: @"%@:%@", h, p]);
|
||||
}
|
||||
}
|
||||
|
||||
if ([wData length] > 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue