Ruby设置HTTP响应头

来源:互联网 发布:网络电影《罪》在哪看 编辑:程序博客网 时间:2024/05/18 17:00

1.找到文件夹app/config/initializers/mime_types.rb

2.写入代码:

Rack::Mime::MIME_TYPES.merge!({ ".m4a" => "audio/mp4", ".M4A" => "audio/mp4",".ogg" => "application/ogg", ".ogx" => "application/ogg", ".ogv" => "video/ogg", ".oga" => "audio/ogg", ".mp4" => "video/mp4", ".m4v" => "video/mp4", ".mp3" => "audio/mpeg"})



3.在浏览器访问你想要的访问的文件,看响应头是否改变.

0 0
原创粉丝点击