Skip to content

Commit

Permalink
Fix pluginCall request type
Browse files Browse the repository at this point in the history
  • Loading branch information
typcn committed Oct 8, 2017
1 parent b871db9 commit 1c0f70c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions bilibili/Browser/TWebView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,9 @@ - (void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSStrin
NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:URL];
request.HTTPMethod = @"POST";
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
if([dic[@"type"] isEqualToString:@"pluginCall"]){
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
}
NSString *postdata = dic[@"data"];
request.HTTPBody = [postdata dataUsingEncoding:NSUTF8StringEncoding];
NSURLConnection* connection = [NSURLConnection connectionWithRequest:request delegate:nil];
Expand Down
2 changes: 1 addition & 1 deletion bilibili/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>3494</string>
<string>3496</string>
<key>Fabric</key>
<dict>
<key>APIKey</key>
Expand Down

0 comments on commit 1c0f70c

Please sign in to comment.