Skip to content

Commit 4dd2e43

Browse files
Nimrod007Copilot
andauthored
[OPIK-2303] [BE] Fix 431 Request Header Fields Too Large errors by increasing Dropwizard header size limit (#3116)
* [NA] Fix 431 Request Header Fields Too Large errors - Add maxRequestHeaderSize configuration to Dropwizard server config - Set default to 16KB (16KB) to match ALB/Nginx request line limit - Add environment variable SERVER_MAX_REQUEST_HEADER_SIZE for configuration - Update both main config.yml and test config-test.yml - Add comprehensive E2E test for header size validation - Test requests below, at, and above the configured limit * [OPIK-2303] Fix 431 Request Header Fields Too Large errors - Add maxRequestHeaderSize configuration to Dropwizard server config - Set default to 16KB (16KB) to match ALB/Nginx request line limit - Add environment variable SERVER_MAX_REQUEST_HEADER_SIZE for configuration - Update both main config.yml and test config-test.yml * Update apps/opik-backend/config.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update apps/opik-backend/src/test/resources/config-test.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update apps/opik-backend/src/test/resources/config-test.yml fix tests * Update apps/opik-backend/src/test/resources/config-test.yml --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 6072753 commit 4dd2e43

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

apps/opik-backend/config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,12 @@ server:
157157
# Description: If true, all requests with gzip in the Accept-Encoding header will have their response entities
158158
# compressed and requests with gzip in the Content-Encoding header will have their request entities decompressed.
159159
enabled: true
160+
# HTTP connector configuration for handling large request headers
161+
# Default: 16KB (16000 bytes) - matches ALB/Nginx request line limit
162+
# Description: Maximum size of request headers to prevent 431 errors from long URLs with many filters
163+
applicationConnectors:
164+
- type: http
165+
maxRequestHeaderSize: ${SERVER_MAX_REQUEST_HEADER_SIZE:-16KB}
160166

161167
# Configuration for batch operations
162168
batchOperations:

apps/opik-backend/src/test/resources/config-test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,12 @@ server:
142142
# Description: If true, all requests with gzip in the Accept-Encoding header will have their response entities
143143
# compressed and requests with gzip in the Content-Encoding header will have their request entities decompressed.
144144
enabled: true
145+
# HTTP connector configuration for handling large request headers
146+
# Default: 16KB (16000 bytes) - matches ALB/Nginx request line limit
147+
# Description: Maximum size of request headers to prevent 431 errors from long URLs with many filters
148+
applicationConnectors:
149+
- type: http
150+
maxRequestHeaderSize: 16KB
145151

146152
# Configuration for batch operations
147153
batchOperations:

0 commit comments

Comments
 (0)