-
Notifications
You must be signed in to change notification settings - Fork 691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AddCustomHeader #1045
Comments
Dont work( |
I've uploaded a modified sample app under: https://github.com/gree/unity-webview/tree/example-for-1045/sample which can be directly opened and built with 2020.3.48f1. Its code is modified as below: You can see headers by tapping the link of https://httpbin.org/headers . It seems working at least on my device (OSCAL Pad 8, Android 11). |
Okay, I also tested the case in which no {
"headers": {
"Accept": "text/html, application/xhtml+ml,application/xml;q=0.9, image/avif, image/webp, image/apng,*/*;q=0.8,application/signed-exchange;v=b3; q=0. 7",
"Accept-Encoding": "gzip, deflate, br"
"Accept-Language": "en-US, en; q=0.9, ja-JP; q=0.8, ja;q=0.7",
"Host": "httpbin.org"
"Sec-Ch-Ua": "\"Not A(Brand\";v=\"99\", \"Android WebView\";v=\"121\", \"Chromium\";v=\"121\"",
"Sec-Ch-Ua-Mobile": "?0"
"Sec-Ch-Ua-Platform": "\"Android\"",
"Sec-Fetch-Dest": "document"
"Sec-Fetch-Mode": "navigate"
"Sec-Fetch-Site": "cross-site"
"Sec-Fetch-User": "?1"
"Upgrade-Insecure-Requests": "1"
"User-Agent": "Mozilla/5.0 (Linux; Android 11; Pad 8 Build/RP1A. 201005.001; WV) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/121. 0.6167.144 Safari/537.36"
"X-Amzn-Trace-Id": "Root=1-65cccf41-70eebc4743f3b6c7aff32ac",
"X-Requested-With": "net.gree.webview. sample"
}
} On the other hand, if {
"headers": {
"Accept": "text/html, application/xhtml+ml,application/xml;q=0.9, image/avif, image/webp, image/apng,*/*;q=0.8, application/signed-exchange; v=b3; q=0. 7",
"Accept-Encoding": "gzip",
"Host": "httpbin.org"
"Sec-Ch-Ua": "\"Not A(Brand\";v=\"99\", \"Android WebView\";v=\"121\", \"Chromium\";v=\"121\"",
"Sec-Ch-Ua-Mobile": "?0"
"Sec-Ch-Ua-Platform": "\"Android\""
"Upgrade- Insecure-Requests": "1"
"User-Agent": "Mozilla/5.0 (Linux; Android 11; Pad 8 Build/RP1A. 201005.001; WV) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/121.0.6167.144 Safari/537.36",
"X-Amzn-Trace-Id": "Root=1-65cccfe2-506af9962ddb4b5d03a7f634",
"X-Auth": "Bearer 0123456789abcdef"
}
} If we use the plugin before #1046 / #1047 and {
"headers": {
"Accept-Encoding": "gzip",
"Host": "httpbin.org"
"User-Agent": "Mozilla/5.0 (Linux; Android 11; Pad 8 Build/RP1A.201005.001; WV) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/121.0.6167.144 Safari/537.36"
"X-Amzn-Trace-Id": "Root=1-65ccd589-1868cada29dba578253daf36",
"X-Auth": "Bearer 0123456789abcdef"
}
} Thus #1046 / #1047 reduces the issue, but incomplete. The implementation utilizes https://developer.android.com/reference/android/webkit/WebViewClient#shouldInterceptRequest(android.webkit.WebView,%20android.webkit.WebResourceRequest) and retrieves existing headers from a WebResourceRequest argument. This WebResourceRequest seems not to have every header, unfortunately. |
Hello. Thanks for the great tool!
I have a question: The "AddCustomHeader" method removes all other headers. Is it possible to add a title without deleting the rest?
The text was updated successfully, but these errors were encountered: