Skip to content

Commit 1a107d9

Browse files
committed
nsurlsession fix proxy dict type 3
1 parent d4f6e37 commit 1a107d9

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

backends/nsurlsession/src/client.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use nyquest_interface::client::{CachingBehavior, ClientOptions, ProxyOptions};
55
use nyquest_interface::{Body, Error as NyquestError, Method, Request, Result as NyquestResult};
66
use objc2::rc::Retained;
77
use objc2::runtime::ProtocolObject;
8-
use objc2::{AllocAnyThread, Message};
8+
use objc2::AllocAnyThread;
99
use objc2_foundation::{
1010
ns_string, NSCharacterSet, NSData, NSDictionary, NSMutableCharacterSet, NSMutableDictionary,
1111
NSMutableURLRequest, NSNumber, NSString, NSTimeInterval, NSURLComponents,
@@ -48,13 +48,17 @@ impl NSUrlSessionClient {
4848
ns_string!("HTTPProxy"),
4949
ns_string!("HTTPPort"),
5050
],
51-
&[ns_string!("1").retain(), http_proxy.0, http_proxy.1],
51+
&[
52+
NSNumber::new_i32(1).into_super().into_super(),
53+
http_proxy.0.into_super(),
54+
http_proxy.1.into_super(),
55+
],
5256
);
5357

5458
if let Some(https_proxy) =
5559
proxy_url_for_https.and_then(|url| parse_proxy_host_port(&url))
5660
{
57-
dict.insert(ns_string!("HTTPSEnable"), &ns_string!("1").retain());
61+
dict.insert(ns_string!("HTTPSEnable"), &NSNumber::new_i32(1));
5862
dict.insert(ns_string!("HTTPSProxy"), &https_proxy.0);
5963
dict.insert(ns_string!("HTTPSPort"), &https_proxy.1);
6064
}

0 commit comments

Comments
 (0)