如何禁用HTTP请求标头中的range选项? [英] How to disable the range option in http request header?

查看:92
本文介绍了如何禁用HTTP请求标头中的range选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过Google chrome下载PDF时,我从服务器收到206状态响应.通过RFC之后,我发现客户端正在向条件GET请求附加一个范围标头.有什么方法可以在发出请求或使用其他浏览器时禁用范围标头吗?

While downloading a PDF via google chrome, i receive a 206 status response from the server. After going through the RFC, i found out that the client is making a conditional GET request appending a range header. is there any way to disable the range header while making the request or using a different browser is a solution?

推荐答案

您正在使用什么服务器?

What server are you using?

这是mod_headers的apache文档.您可以将Accept-Ranges标头设置为none

This is the apache documentation for mod_headers. You can set the Accept-Ranges header to none

http://httpd.apache.org/docs/2.2/mod/mod_headers.html

尝试在httpd.conf文件中设置无接受范围".

Try setting "Accept-Ranges none" in the httpd.conf file.

mod_headers模块也必须加载到服务器中.

The mod_headers module must be loaded in the server too.

此外,当通过chrome或adobe插件等(其他插件)完成pdf或经常流式传输文件的请求时,他们将始终尝试使用Range:0-进行GET请求,并尝试对文件以向用户显示内容(如果pdf很大,则显示pdf的第一页)并管理下载,因此服务器将以206状态进行响应.

Also, when the request of a pdf or often streamed file it's done through chrome or an adobe plugin or so (other plugins), they will always attempt to do the GET request with Range:0- and try partial requests of the file to show content to the user (first pages of the pdf if the pdf is big) and manage the download so the server will respond with 206 status.

这篇关于如何禁用HTTP请求标头中的range选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆