ObjFW  Check-in [c25601d462]

Overview
Comment:OFHTTPClient: Properly escape path & query string

OFURL used to return all URL parts escaped, however, when this was
changed, OFHTTPClient was not adjusted.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: c25601d462232f33e8946d861bf1f5ef96ae60a11e2541a08abeb68d9066777a
User & Date: js on 2016-07-02 23:35:56
Other Links: manifest | tags
Context
2016-07-03
11:24
runtime: Add class_addMethod() check-in: d4cae4c963 user: js tags: trunk
2016-07-02
23:35
OFHTTPClient: Properly escape path & query string check-in: c25601d462 user: js tags: trunk
23:35
OFString+URLEncoding.m: Do not parse + as space check-in: 32bc855af9 user: js tags: trunk
Changes

Modified src/OFHTTPClient.m from [2ea850eecb] to [c92bc66cbb].

373
374
375
376
377
378
379
380
381




382
383
384
385


386
387
388
389
390
391
392
373
374
375
376
377
378
379


380
381
382
383
384
385
386

387
388
389
390
391
392
393
394
395







-
-
+
+
+
+



-
+
+







	 * 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.
	 */
	if ([URL query] != nil)
		requestString = [OFMutableString stringWithFormat:
		    @"%s /%@?%@ HTTP/%@\r\n",
		    of_http_request_method_to_string(method), [URL path],
		    [URL query], [request protocolVersionString]];
		    of_http_request_method_to_string(method),
		    [[URL path] stringByURLEncoding],
		    [[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),
		    [[URL path] stringByURLEncoding],
		    [request protocolVersionString]];

	headers = [[[request headers] mutableCopy] autorelease];
	if (headers == nil)
		headers = [OFMutableDictionary dictionary];

	if ([headers objectForKey: @"Host"] == nil) {