请求标头字段Access-Control-Allow-Headers不允许使用范围

时间:2016-02-29 18:39:05

标签: apache header

我正在尝试使用HLS JS获取视频,但是我收到了以下错误:

XMLHttpRequest cannot load http://example.com/video.ts. Request header field Range is not allowed by Access-Control-Allow-Headers in preflight response.

我正在使用Apache配置:

Header set Access-Control-Allow-Origin "*"
    Header set Access-Control-Allow-Methods "OPTIONS, HEAD, GET, POST, PUT, DELETE"
    Header set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Key, Content-Length, Authorization"


    AddType video/webm            .webm
    AddType video/mp4             .mp4
    AddType video/ogg             .ogv
    AddType application/x-mpegurl .m3u8

    # hls transport stream segments:
    AddType video/mp2t            .ts
    # subtitle text tracks:
    AddType text/vtt              .vtt

我google了一点,我想知道我应删除/添加哪些标题?

谢谢

1 个答案:

答案 0 :(得分:6)

我刚刚添加了

Header set Access-Control-Allow-Headers "Range"