0
我有這樣的HTTP請求的攔截器:圖片GET請求攔截
var app = angular.module('mobApp.services');
app.factory('httpRequestInterceptor', function($q, $injector) {
return {
request: function(config) {
var utils = $injector.get('Utils'),
userDetails = utils.getCurrentUserDetails();
config.headers.Authorization = "Token 12309123019238";
if(userDetails) {
config.headers['X-AccessKey'] = userDetails.apiKey;
config.headers['X-UserId'] = userDetails.id;
}
return config;
}
}
});
app.config(['$httpProvider', function($httpProvider) {
$httpProvider.interceptors.push('httpRequestInterceptor');
}]);
它添加X-
頭到所有GET/POST請求除了一個圖像GET請求。爲什麼?