In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
In this issue, the editor will bring you an analysis of the causes of Bad Request-Request Too Long caused by cnzz statistical codes. The article is rich in content and analyzed and described from a professional point of view. I hope you can get something after reading this article.
Cause of the problem
Today, a netizen reported to us that when we open some blog posts with Chrome, there will be "Bad Request-Request Too Long. HTTP Error 4000.The size of the request headers is too long." Error page of:
There is no problem with IE and Firefox, only Chrome.
We encountered such a problem once before, when we thought the Chrome problem was caused by accident, so we renamed the Chrome configuration file in "% LOCALAPPDATA%\ Google\" and asked Chrome to rebuild the configuration, which solved the problem.
Today, when this problem emerges again, we cannot ignore it. We must find out the real cause of the problem and find a solution.
Solution process
At first we speculated that there may be some reason why the request header issued by Chrome contains too much content. It is normal to check the URL requested by Chrome, and no exception is found in Request Header. Since we can't find the cause of the problem in Chrome, let's start with the server. The request will be a little longer, as long as the user can see the normal content.
Where on earth did the server IIS return this error? At first I thought it was Request Filtering Module, but adjusting the Request Limits setting won't solve the problem, and disabling Request Filtering Module won't solve the problem either.
Later in the official IIS forum post HTTP 400. The size of the request headers is too long learned that this error was returned by Http.sys, and the request header length limit is determined by two parameters in the registry HKEY_LOCAL_MACHINE\ System\ CurrentControlSet\ Services\ HTTP\ Parameters: MaxFieldLength and MaxRequestBytes, both of which are 16384 bytes by default. For more information, please see Http.sys registry settings for IIS.
Since changing these two settings requires restarting IIS (net stop http, net start http, iisreset) and only ostensibly solving the problem, we did not take this approach immediately. Looking back at the request header in Chrome, I suddenly found that the value of cookie is so long.
Take a closer look at cookie:
A lot of cnzz_eid, which is generated by the cnzz statistics code, but we don't use cnzz in the blog. However, some user blogs add their own cnzz statistical code. We checked some pages that generated "Bad Request-Request Too Long", and some did add cnzz code.
We manually removed some cookie with cnzz_eid from Chrome, and the problem was solved.
It's cnzz's fault!
Why doesn't this problem occur in IE and Firefox?
It is possible that IE and Firefox automatically truncate requests for request header that are too long, while Chrome ignores it.
When IIS returns "Bad Request-Request Too Long. HTTP Error 400. The size of the request headers is too long." Indicates that the length of the request header issued by the client exceeds the Http.sys limit, which is determined by the two parameters MaxFieldLength and MaxRequestBytes in the registry "HKEY_LOCAL_MACHINE\ System\ CurrentControlSet\ Services\ HTTP\ Parameters". The default value is 16384 bytes.
The above is the analysis of the reasons for the Bad Request-Request Too Long caused by the cnzz statistical code shared by the editor. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.