Navigator.sendBeacon() to pass header information

后端 未结 6 1920
Happy的楠姐
Happy的楠姐 2020-12-06 00:51

I am using navigator for communicating with the server , but problem is that we need to pass some header information as there is filter which recognise the request is from t

6条回答
  •  生来不讨喜
    2020-12-06 01:06

    If you're using Chrome and you're trying to set the content-type header, you'll probably have some issues due to security restrictions :

    Uncaught DOMException: Failed to execute 'sendBeacon' on 'Navigator': sendBeacon() with a Blob whose type is not any of the CORS-safelisted values for the Content-Type request header is disabled temporarily. See http://crbug.com/490015 for details.
    

    See this thread

提交回复
热议问题