Index: src/OFHTTPClient.m ================================================================== --- src/OFHTTPClient.m +++ src/OFHTTPClient.m @@ -318,10 +318,11 @@ { void *pool = objc_autoreleasePoolPush(); OFURL *URL = [request URL]; OFString *scheme = [URL scheme]; of_http_request_method_t method = [request method]; + OFString *path; OFMutableString *requestString; OFString *user, *password; OFMutableDictionary OF_GENERIC(OFString*, OFString*) *headers; OFDataArray *body = [request body]; OFTCPSocket *socket; @@ -374,21 +375,26 @@ /* * As a work around for a bug with split packets in lighttpd when using * HTTPS, we construct the complete request in a buffer string and then * send it all at once. */ + + path = [URL path]; + + if (path == nil) + path = @"/"; if ([URL query] != nil) requestString = [OFMutableString stringWithFormat: @"%s %@?%@ HTTP/%@\r\n", - of_http_request_method_to_string(method), [URL path], + of_http_request_method_to_string(method), path, [[URL query] stringByURLEncoding], [request protocolVersionString]]; else requestString = [OFMutableString stringWithFormat: @"%s %@ HTTP/%@\r\n", - of_http_request_method_to_string(method), [URL path], + of_http_request_method_to_string(method), path, [request protocolVersionString]]; headers = [[[request headers] mutableCopy] autorelease]; if (headers == nil) headers = [OFMutableDictionary dictionary];