When the request header is too long and is directly rejected by the server, should you receive the Cookie first or the custom header first?

📅 October 12, 2026 25

When the request header is too long and is directly rejected by the server, should we receive the Cookie first or the custom header? First attribute, then receive the amount: The first step is to determine whether the server rejected the total amount of the request header exceeding the limit or the individual field exceeding the limit, both of which correspond to the same client error status code 431; after attributing, the order of receiving the amount is generally to receive the Cookie field, which is the easiest to swell, and then look at the custom header and the gateway append items, because in most scenarios, Cookie is the fastest growing in volume and also the easiest to safely reduce.

What does the server return when it rejects?

According to MDN's definition, the status code 431 indicates that the server refuses to process the request due to the request's HTTP header being too long. After reducing the volume of the request header, it can be resent. This status code has two usages: the total amount of the request header is too large, or a single header field is too large. MDN suggests that the server should specify which one in the response body, and ideally, indicate which headers are too large, so that the client knows whether to clear the Cookie or have the caller change the code. If the response body only says

Why is the request header getting bigger and bigger?

There are three common sources. The first is tracking cookies: advertising and statistics components continuously write identifiers to cookies, accumulating them with multiple visits, and a single domain cookie may swell to a considerable volume.The second is the addition of custom headers by third-party scripts: fields for埋点, experimental platform, and link tracking need to be added separately, and the total amount increases accordingly. The third is the addition of proxy and gateway: each layer of the forwarding chain may add a forwarding header.Three types of sources are not felt daily, but only when a user collides with the limit carrying a large Cookie, and it often manifests as 'the same interface, some users are normal and some report errors'.

How should the troubleshooting order be arranged?

First, attribute the cause: let the server write the error response body clearly whether it is total or single field over-standard. This step determines who to find to make changes next. Then, reproduce: export the request header from the user environment with the problem, compare it with the header of a normal user request for the same path, and the extra part is the source of expansion. Then, measure the volume: if the total exceeds the standard, clear the Cookie first, especially the tracking fields; if a single field exceeds the standard, directly handle that field, split or shorten it. After collecting, observe for a period of time, confirm that it no longer recurs, and then solidify the changes into the configuration or code.

Why collect cookies first?

Cookies have three characteristics that put them at the forefront of the collection order: they are automatically carried by the browser in each request, and users are not aware of them and cannot clean them up; they accumulate throughout the year, and the fields left behind when the writing component has already been decommissioned are still there; the reduction action is completely controllable on the server side, and the effect can be achieved by issuing shorter cookies, splitting domains, and setting reasonable expiration periods. Custom headers are different; changing them requires coordination with each entry, and the cycle is long. Therefore, collecting cookies first is the cheapest path, not because custom headers are unimportant, but because they can be changed the fastest and have the clearest impact.

Common questions

What is the difference between 431 and 413?413 is for large request body, 431 is for long request headers; refer to the former for file upload errors, and the latter for interfaces with a large number of Cookies.

How can users temporarily自救?Just clear the Cookies of the corresponding site and retry to restore access; but the root cause is usually too many Cookies written by the server side, and cleaning up is only a temporary relief.

Can the header size limit of the gateway layer be increased directly?Answer: Can be adjusted, but only recommended as a buffer. The continuous growth of the head volume indicates that there are components pushing things into it, first attribute the amount received, then discuss adjusting the limit.

Related articles

What do the surge quota and non-delay parameters in the traffic control rules change individually, who decides whether to queue or reject?

Based on the official nginx documentation, break down the three things of rate limiting: rate key statistics, bucket release; burst determines how many extra requests can wait in line, nodelay and delay determine the rhythm at which queued requests are processed; whether a single request is queued or rejected is determined by whether the waiting number at arrival exceeds the burst limit, the return code can be customized with commands.

2026-10-12

What capabilities can be verified by the online experience station and API documentation when selecting?

Do not stop at the feature list: Use the official online experience station to actually open the background to confirm the process and capability boundaries, use the public interface document to confirm which capabilities and fields can be accessed, and then see if the server capabilities can be accessed by external AI clients through a unified protocol. This article provides a list of executable checks and common misjudgments.

2026-10-12

With a security notice rated at twenty-three points out of twenty-five, how should the site judge and prioritize handling?

High rating does not mean that the disposal order is in front. Take a high-risk announcement of Drupal core announcement as an example: it gives the score under the 25-point system, exposure premise and impact dimension, and also explains that the cause only acts on a specific database and has detected external exploitation attempts. This article explains how to read this kind of scoring, what other lines need to be supplemented outside the score, and then gives the site disposal order and the way to leave a way out before and after the upgrade.

2026-10-12

When the inline data address is not covered by the content filtering rules, from which path does the cross-site scripting come in?

Content filtering rules are mostly written based on tags and attribute names. When executable carriers such as inline data addresses are not covered, the script can change to a different path to enter the rendering phase. This article combines the causes of insufficient filtering of inline data addresses in Joomla's core announcements, explaining the types of executable carriers in rich text, why filtering by tag name alone can lead to omissions, and where sensitive word filtering, keyword replacement, and structural layer verification should be placed at each level.

2026-10-12

How should the announcement handle the defect type written as no longer supported, and what should be done when the affected version is all inclusive?

The type of defect is written as no longer supported, and the affected versions are all security announcements, meaning the project has been abandoned by the maintainer, there will be no fix versions, and the official recommendation is to uninstall instead of upgrade. This article takes the Drupal October 2026 announcement as an example to explain the reading and handling order of such announcements: confirm the scope in use, backup first, disable modules, and look for alternatives.

2026-10-12

The action of clearing the cache can delete any directory, what kind of problem will arise when a piece of name is spliced into the path.

Joomla announcement CVE-2026-90915 shows that the lack of validation of the cache group name can lead to path traversal, and clearing the cache can then delete any directory. This article analyzes the cause of the name being拼 into the path, and provides a review list of cache, upload, and backup three types of path splicing positions, and explains the complementary actions of input whitelist, root directory limitation, and backup before operation in addition to upgrading.

2026-10-12

When the email template does not have an escape mechanism, the content filled in behind the scenes will be executed in which link.

Joomla announcement CVE-2026-90918 points out that the email template function lacks an escaping mechanism, leading to multiple extensions appearing cross-site scripting vectors. The template output and page output share the same escaping requirement, and background input items, collected content, and user submitted content are all injection sources; the sensitive word filtering and content review on the writing side cannot replace the escaping on the output side, and the two levels of security should be configured separately.

2026-10-12

The interface for saving data did not check the login status, to what extent will the visitor-level account be built?

Joomla announcement CVE-2026-90907 shows that the data saving controller can be used to create unauthorized guest-level users when the login status is not checked. To assess the impact, consider three things: whether it can create accounts in bulk, which user group the account falls into, and what permissions the group can reach. The three audit points of interface authorization: confirm the login status for each interface, verify the default group of the new account, and raise the cost of bulk abuse by publicly entering a verification code.

2026-10-12