Fix to use '/' if there is no path in the url.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@18548 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2004-02-06 18:20:06 +00:00
parent 74fbd24a5b
commit ca1d10c363
2 changed files with 14 additions and 3 deletions

View file

@ -1,3 +1,7 @@
2004-02-06 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSHTTPURLHandle.m: If there is no path in the URL, assume '/'
2004-02-04 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSPropertyList.m: Rewrote the object reference handling

View file

@ -557,6 +557,13 @@ static void debugWrite(NSData *data)
NSString *key;
NSMutableData *buf;
NSString *method;
NSString *path;
path = [[url path] stringByTrimmingSpaces];
if ([path length] == 0)
{
path = @"/";
}
/*
* See if the connection attempt caused an error.
@ -682,18 +689,18 @@ static void debugWrite(NSData *data)
if ([url port] == nil)
{
s = [[NSMutableString alloc] initWithFormat: @"%@ http://%@%@",
method, [url host], [url path]];
method, [url host], path];
}
else
{
s = [[NSMutableString alloc] initWithFormat: @"%@ http://%@:%@%@",
method, [url host], [url port], [url path]];
method, [url host], [url port], path];
}
}
else // no proxy
{
s = [[NSMutableString alloc] initWithFormat: @"%@ %@",
method, [url path]];
method, path];
}
if ([[url query] length] > 0)
{