简体   繁体   中英

iOS - UIWebView - weird concatenation to url

I have a UIWbView and I load it with an encoded url: http%3A%2F%2Fwww.google.com%0A

When i debug, and stop at:

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType 

the [[request URL] absoluteString] returns

{ URL: file://http%3A%2F%2Fwww.google.com%0A }

The framework added file:// prefix, WHY??? I didn't ask for that... :/

It assumed it was a file:// URL as it didn't find a URL scheme in http%3A%2F%2Fwww.google.com%0A .

Change the URL to http://www.google.com and it will be fine (that trailing %0A is also suspicious).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM