You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Verify and implement the NGINX 8 KiB header line limit (#3574)
* Verify and implement the NGINX 8 KiB header line limit
Observed against real Vuforia on 2026-09-08: both the Target API and
the Query API return NGINX's "400 Request Header Or Cookie Too Large"
HTML response for any header line of 8191 bytes or more, and accept a
line of 8190 bytes. The mock now does the same, checked before any
other validation, and a test runs the cases against every backend.
The related behaviors which were observed but are not implemented (an
Envoy cookie allowance, the AWS load balancer's 16 KiB limit and the
Query API application server's 431) are recorded in the differences
document, and the never-attempted entry is removed.
Closes#3571
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* Retry the concrete requests timeout and connection errors in CI
pytest-retry checks whether the failing exception's type is in the
filtered tuple, so a subclass of a listed type is never retried. The
tuple listed requests' Timeout, but requests raises ReadTimeout and
ConnectTimeout, so a TLS handshake timeout against real Vuforia failed
a job outright instead of being retried. List the concrete types, and
requests' ConnectionError, explicitly.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Vuforia uses NGINX in front of both the Target API and the Query API.
143
+
NGINX reads each request header line into an 8 KiB buffer, and returns a 400 (``BAD REQUEST``) response with an HTML body titled ``400 Request Header Or Cookie Too Large`` for a line which does not fit.
144
+
The line's terminating CRLF also counts towards the buffer, so the longest accepted line is 8190 bytes, where a line is the header name, a colon, a space and the value.
145
+
This was observed against real Vuforia on 2026-09-08.
146
+
147
+
The mock returns that response for any header line longer than 8190 bytes.
148
+
The mock does not implement the following related behaviors, which were observed in the same session:
149
+
150
+
* The Target API's Envoy layer lets a ``Cookie`` line slightly over the limit through.
151
+
A ``Cookie`` line of 8193 bytes was accepted and one of 8300 bytes was rejected.
152
+
* The Target API's AWS load balancer rejects a header line of 16384 bytes or more itself, with a shorter HTML body and a ``Server: awselb/2.0`` header.
153
+
A ``Cookie`` line of that size passes the load balancer and is rejected by NGINX instead.
154
+
* The Query API's application server rejects a request whose headers total about 8 KiB with a 431 (``REQUEST HEADER FIELDS TOO LARGE``) HTML response before the NGINX limit is reached.
155
+
With the headers which a query normally has, a header line of 7500 bytes was accepted and one of 8000 bytes was rejected this way.
156
+
* The Model Target Web API, the OAuth2 token endpoint and reco counts report downloads in the mock do not apply the limit.
The mock now returns NGINX's ``400 Request Header Or Cookie Too Large`` response for any request header line longer than 8190 bytes, as real Vuforia does.
0 commit comments