MetaMask / metamask-mobile

Mobile web browser providing access to websites that use the Ethereum blockchain
https://metamask.io
Other
2.16k stars 1.12k forks source link

POST request via fetch do not send cors headers #1466

Closed Fi1osof closed 1 year ago

Fi1osof commented 4 years ago

Describe the bug Write request headers in native browser:

Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7,fr;q=0.6,it;q=0.5,cy;q=0.4,la;q=0.3,zh-CN;q=0.2,zh;q=0.1,pt;q=0.1,zu;q=0.1
Cache-Control: no-cache
Connection: keep-alive
Content-Length: 72
Content-Type: application/json
Cookie: ....
Host: my-host
Origin: https://my-host
Pragma: no-cache
Referer: https://my-host
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36

Request headers from metamask:

Provisional headers are shown
Origin: https://my-host
Referer: https://my-host
Sec-Fetch-Dest: empty
User-Agent: Mozilla/5.0 (Linux; Android 10; Android SDK built for x86 Build/OSM1.180201.023) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.92 Mobile Safari/537.36

Result POST requests is incorrect.

To Reproduce Open https://prisma-cms.com/ via metamask and monitor requests to https://prisma-cms.com/api/ (for example via chrome debug console). Response will contains HTML-code, not JSON data.

Smartphone (please complete the following information):


to be added after bug submission by internal support / PM Severity

typedrobin commented 3 years ago

My situation is Cookie header disappear.

gantunesr commented 2 years ago

Related https://github.com/MetaMask/metamask-mobile/issues/1479

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 7 days. Thank you for your contributions.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 7 days with no activity. If you feel this was closed in error please reopen and provide evidence on the current production app. Thank you for your contributions.