Index: src/OFHTTPRequest.m ================================================================== --- src/OFHTTPRequest.m +++ src/OFHTTPRequest.m @@ -129,11 +129,11 @@ sock = [[[of_http_request_tls_socket_class alloc] init] autorelease]; } @try { - OFString *line; + OFString *line, *path; OFMutableDictionary *s_headers; OFDataArray *data; OFEnumerator *enumerator; OFString *key; int status; @@ -152,17 +152,19 @@ t = "GET"; if (requestType == OF_HTTP_REQUEST_TYPE_HEAD) t = "HEAD"; if (requestType == OF_HTTP_REQUEST_TYPE_POST) t = "POST"; + + if ((path = [URL path]) == nil) + path = @""; if ([URL query] != nil) [sock writeFormat: @"%s /%@?%@ HTTP/1.0\r\n", - t, [URL path], [URL query]]; + t, path, [URL query]]; else - [sock writeFormat: @"%s /%@ HTTP/1.0\r\n", - t, [URL path]]; + [sock writeFormat: @"%s /%@ HTTP/1.0\r\n", t, path]; if ([URL port] == 80) [sock writeFormat: @"Host: %@\r\n", [URL host]]; else [sock writeFormat: @"Host: %@:%d\r\n", [URL host],