changing the referrer of an Ajax POST

后端 未结 4 976
[愿得一人]
[愿得一人] 2020-12-01 13:58

Anyone knows if with jquery or general javascript, I can change the referrer from the header in an http ajax call?

basically I want it to be sent from my page but ha

4条回答
  •  春和景丽
    2020-12-01 14:37

    You can always use this :

    jQuery.ajaxSetup({
        'beforeSend': function(xhr) {xhr.setRequestHeader("header key", "header value")}
    })
    

    But ofcourse, the browser can have a different opinion about the referer header. This should be tested :)

提交回复
热议问题