Set referer for xml.HTTP.Request?

前端 未结 2 2052
不知归路
不知归路 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:48

    You can try something like this:

    xhr.setRequestHeader('X-Referer', window.location.href);
    

    And then read this custom X-Referer header.

提交回复
热议问题