The request filtering module is configured to deny a request where the query string is too long问题解决
2011-09-11 08:26
706 查看
近来发现 公司的后台系统在通过Rss操作新闻时候,用火狐浏览器操作时候,页面正常,但是用IE7,6的时候,浏览新闻的时候信息出现乱码。经过检查,发现是通过URL传值的问题,所以对url字符串进行encodeURIComponent对url字符串内容进行编码,问题解决,但是有时候会出现 The request filtering module is configured to deny a request where the query string is too long,问题的原因是 以get方式传字符串的时候,有长度限制。
IIS 7对于Query String有长度限制。默认为2048.
该问题的解决办法可以通过修改configuration/system.webServer/security/requestFiltering/requestLimits@maxQueryString setting.
<requestLimits maxQueryString="length" />
各浏览器与各Web Server对URL均有长度的限制如下:
在http协议中,其实并没有对url长度作出限制,往往url的最大长度和用户浏览器和Web服务器有关,不一样的浏览器,能接受的最大长度往往是不一样的,当然,不一样的Web服务器能够处理的最大长度的URL的能力也是不一样的。
下面就是对各种浏览器和服务器的最大处理能力做一些说明.
Microsoft Internet Explorer (Browser)
IE浏览器对URL的最大限制为2083个字符,如果超过这个数字,提交按钮没有任何反应。
Firefox (Browser)
对于Firefox浏览器URL的长度限制为65,536个字符,但当我测试时,最大只能处理8182个字符,这是因为url的长度除了浏览器限制外,还会受Web服务器的限制。
Safari (Browser)
URL最大长度限制为 80,000个字符。
Opera (Browser)
URL最大长度限制为190,000个字符。
Google (chrome)
url长度一旦超过8182个字符时,出现如下服务器错误:
写道
Request-URI Too Large
The requested URL's length exceeds the capacity limit for this server.
Apache/2.2.12 (Ubuntu) Server at 127.0.1.1 Port 80
Apache (Server)
能接受最大url长度为8,192个字符。
Microsoft Internet Information Server(IIS)
能接受最大url的长度为16,384个字符。
通过上面的数据可知,为了让所有的用户都能正常浏览,我们的URL最好不要超过IE的最大长度限制(2038个字符),当然,如果URL不直接提供给用户,而是提供给程序调用,侧这时的长度就只受Web服务器影响了。
可能有些朋友会想当然的认为,如果最大长度限制为2038字符,是不是参数差不多可以传递1000个左右的汉字。这样认为其实是不对的,对于中文的传递,最终会为urlencode后的编码形式进行传递,如果浏览器的编码为UTF8的话,一个汉字最终编码后的字符长度为9个字符。
IIS 7对于Query String有长度限制。默认为2048.
该问题的解决办法可以通过修改configuration/system.webServer/security/requestFiltering/requestLimits@maxQueryString setting.
<requestLimits maxQueryString="length" />
各浏览器与各Web Server对URL均有长度的限制如下:
在http协议中,其实并没有对url长度作出限制,往往url的最大长度和用户浏览器和Web服务器有关,不一样的浏览器,能接受的最大长度往往是不一样的,当然,不一样的Web服务器能够处理的最大长度的URL的能力也是不一样的。
下面就是对各种浏览器和服务器的最大处理能力做一些说明.
Microsoft Internet Explorer (Browser)
IE浏览器对URL的最大限制为2083个字符,如果超过这个数字,提交按钮没有任何反应。
Firefox (Browser)
对于Firefox浏览器URL的长度限制为65,536个字符,但当我测试时,最大只能处理8182个字符,这是因为url的长度除了浏览器限制外,还会受Web服务器的限制。
Safari (Browser)
URL最大长度限制为 80,000个字符。
Opera (Browser)
URL最大长度限制为190,000个字符。
Google (chrome)
url长度一旦超过8182个字符时,出现如下服务器错误:
写道
Request-URI Too Large
The requested URL's length exceeds the capacity limit for this server.
Apache/2.2.12 (Ubuntu) Server at 127.0.1.1 Port 80
Apache (Server)
能接受最大url长度为8,192个字符。
Microsoft Internet Information Server(IIS)
能接受最大url的长度为16,384个字符。
通过上面的数据可知,为了让所有的用户都能正常浏览,我们的URL最好不要超过IE的最大长度限制(2038个字符),当然,如果URL不直接提供给用户,而是提供给程序调用,侧这时的长度就只受Web服务器影响了。
可能有些朋友会想当然的认为,如果最大长度限制为2038字符,是不是参数差不多可以传递1000个左右的汉字。这样认为其实是不对的,对于中文的传递,最终会为urlencode后的编码形式进行传递,如果浏览器的编码为UTF8的话,一个汉字最终编码后的字符长度为9个字符。
相关文章推荐
- Python3下的ssl certificate:Can't connect to HTTPS URL because the SSL module is not available.问题解决
- Unable to add module to the current project as it is not of packaging type 'pom' 问题解决
- 如何解决这类问题:The string "--" is not permitted within comments.
- hive的Specified key was too long; max key length is 767 bytes问题解决
- PHP配置的严重问题,终于解决了,The FastCGI Handler was unable to process the request.
- 在Ubuntu/Linux环境下使用MySQL:解决com.mysql.jdbc.PacketTooBigException: Packet for query is too large的问题
- 解决com.mysql.jdbc.PacketTooBigException: Packet for query is too large (3158064)问题
- Request.QueryString取不到值的问题或者取值错误 或者有的取的到有的取不到的问题的解决.
- Redis "MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk"问题的解决
- The connection to adb is down, and a severe error has occured.问题解决方法小结
- android中The connection to adb is down,问题和解决
- 解决com.sun.tools.javac.Main is not on the classpath / Unable to find a javac compiler 的问题
- 解决php的“It is not safe to rely on the system’s timezone settings”问题
- The connection to adb is down, and a severe error has occured.问题解决
- swift 第三方库迁移错误解决“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choo
- 解决The SDK platform-tools version ((23)) is too old to check APIs compiled with API 23
- 完美解决“The identity used to sign the executable is no longer valid.”问题
- 教新手一步步解决:Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to和更新gradle问题
- [MVC] 获取请求时缺少"+"的处理办法 How to fix the bug that missing plus in Request.QueryString/Form
- 18. 优雅解决The android gradle plugin version 3.0.0-alpha1 is too old, update to the latest version