请求标头字段Access-Control-Allow-Headers

时间:2016-01-10 19:40:01

标签: angularjs http oauth cors

我使用angular js实现了基于令牌的oauth登录,在我登录任何提供者之后,我在使用$http之后的第三方API(tmdb)服务之后的每个get请求上都收到了上述错误

然后我退出后,一切都恢复正常。我没有设置,修改任何内容..为什么会发生这种情况?

我尝试过的事情

$http.defaults.headers.common.Authorization = undefined ;

delete $httpProvider.defaults.headers.common['X-Requested-With'];
delete $httpProvider.defaults.headers.common['Authorization'];
$httpProvider.defaults.headers.common.Authorization = undefined ;

登录任何oauth后请求标题:

Vary:Accept-Encoding
X-RateLimit-Limit:40
X-RateLimit-Remaining:28
X-RateLimit-Reset:1452454281
Request Headers
view parsed
OPTIONS /3/movie/popular?api_key=de75f0397cd2a7184400275e3331f039 HTTP/1.1
Host: api.themoviedb.org
Connection: keep-alive
Cache-Control: max-age=0
Access-Control-Request-Method: GET
Origin: http://popcorn-movies.dev:3001
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2612.0 Safari/537.36
Access-Control-Request-Headers: accept, authorization
Accept: */*
Referer: http://popcorn-movies.dev:3001/
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8,hi;q=0.6

0 个答案:

没有答案