阻止浏览器添加请求标头:连接



我使用Angular 1.0,当我进行XHR调用时;连接:保持活动,"Pragma:无缓存","缓存控制:无缓存"被添加到请求标头中。如何防止它被添加到XHR请求中?

如果此标头被传递,会发生什么?

在应用程序运行时冷配置标头

module.run(function($http) {
$http.defaults.headers.common.Connection = '';
});

https://docs.angularjs.org/api/ng/service/$http#设置http头

最新更新