mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: MacCloud: convert + to %2B in url query, improve compatibility
This commit is contained in:
parent
53e69da298
commit
f8862b158d
1 changed files with 9 additions and 0 deletions
|
|
@ -399,11 +399,20 @@ procedure TMiniHttpMethod.setQueryToURL(const request: NSMutableURLRequest;
|
|||
var
|
||||
components: NSURLComponents;
|
||||
queryItems: NSArray;
|
||||
queryString: NSString;
|
||||
begin
|
||||
queryItems:= THttpClientUtil.toQueryItems( query );
|
||||
components:= NSURLComponents.componentsWithURL_resolvingAgainstBaseURL(
|
||||
request.URL, False );
|
||||
components.setQueryItems( queryItems );
|
||||
|
||||
queryString:= components.percentEncodedQuery;
|
||||
if queryString.containsString( NSSTR('+') ) then begin
|
||||
queryString:= queryString.stringByReplacingOccurrencesOfString_withString(
|
||||
NSSTR('+'), NSSTR('%2B') );
|
||||
components.setPercentEncodedQuery( queryString );
|
||||
end;
|
||||
|
||||
request.setURL( components.URL );
|
||||
end;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue