ObjFW  Diff

Differences From Artifact [5d3409efa0]:

  • File src/OFHTTPClient.m — part of check-in [516517deb3] at 2016-08-21 14:00:20 on branch trunk — OFURL: Do not URL decode and reencode parts

    URL decoding and reencoding is not lossless: For example, if the query
    was foo=bar&qux=foo%25bar, it will be decoded to foo=bar&qux=foo&bar and
    then reencoded to foo=bar%25qux=foo%25bar, which is a different thing.

    The only way to solve this is to let the application handle the URL
    decoding and encoding according to its own rules, as those might be
    different depending on the application. (user: js, size: 17510) [annotate] [blame] [check-ins using]

To Artifact [9433d07795]:


614
615
616
617
618
619
620
621
622
623
624
625
626

627
628
629
630
631
632
633
	    [redirect hasPrefix: @"https://"])) {
		OFURL *newURL;
		bool follow;

		newURL = [OFURL URLWithString: redirect
				relativeToURL: URL];

		if ([_delegate respondsToSelector:
		    @selector(client:shouldFollowRedirect:statusCode:request:)])
			follow = [_delegate client: self
			      shouldFollowRedirect: newURL
					statusCode: status
					   request: request];

		else {
			/*
			 * 301, 302 and 307 should only redirect with user
			 * confirmation if the request method is not GET or
			 * HEAD. Asking the delegate and getting true returned
			 * is considered user confirmation.
			 */







|
|



|
>







614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
	    [redirect hasPrefix: @"https://"])) {
		OFURL *newURL;
		bool follow;

		newURL = [OFURL URLWithString: redirect
				relativeToURL: URL];

		if ([_delegate respondsToSelector: @selector(client:
		    shouldFollowRedirect:statusCode:request:response:)])
			follow = [_delegate client: self
			      shouldFollowRedirect: newURL
					statusCode: status
					   request: request
					  response: response];
		else {
			/*
			 * 301, 302 and 307 should only redirect with user
			 * confirmation if the request method is not GET or
			 * HEAD. Asking the delegate and getting true returned
			 * is considered user confirmation.
			 */