Index: src/OFHTTPClient.m ================================================================== --- src/OFHTTPClient.m +++ src/OFHTTPClient.m @@ -316,10 +316,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; @@ -372,22 +373,22 @@ /* * 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] stringByURLEncodingWithIgnoredCharacters: "/"]; + if ([URL query] != nil) requestString = [OFMutableString stringWithFormat: @"%s /%@?%@ HTTP/%@\r\n", - of_http_request_method_to_string(method), - [[URL path] stringByURLEncoding], + 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] stringByURLEncoding], + of_http_request_method_to_string(method), path, [request protocolVersionString]]; headers = [[[request headers] mutableCopy] autorelease]; if (headers == nil) headers = [OFMutableDictionary dictionary];