Skip to content

Commit

Permalink
fir for: NativeXHR: Invalid url scheme 'null'
Browse files Browse the repository at this point in the history
  • Loading branch information
hikmatfauzyhitachienergy committed Feb 23, 2024
1 parent 5399bc5 commit ea5deb4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ios/CDVWKWebViewFileXhr.m
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@ - (void) performNativeXHR:(NSDictionary<NSString *, id> *) body inWebView:(WKWeb
return sendResult( @{ @"error" : @"Invalid url"});
}

urlString = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

NSURL *url = [NSURL URLWithString:urlString];

if (![url.scheme.lowercaseString isEqualToString:@"http"] && ![url.scheme.lowercaseString isEqualToString:@"https"]) {
Expand Down

0 comments on commit ea5deb4

Please sign in to comment.