Set referer for xml.HTTP.Request?

前端 未结 2 2057
不知归路
不知归路 2020-12-06 14:29

I am successfully sending xml.http.request by using

var createCORSRequest = function(method, url) {
  var xhr = new XMLHttpRequest();
  if (\"withCredentials         


        
2条回答
  •  广开言路
    2020-12-06 14:42

    You cannot. The XMLHttpRequest specification forbids the altering of the referer header (this stops sites lying in it to bypass security checks which some sites use the referer for).

    Terminate these steps if header is a case-insensitive match for one of the following headers:

    • Referer

提交回复
热议问题