[TT-15160][TT-16062] Header request validation fix#7526
[TT-15160][TT-16062] Header request validation fix#7526
Conversation
🚨 Jira Linter FailedCommit: The Jira linter failed to validate your PR. Please check the error details below: 🔍 Click to view error detailsNext Steps
This comment will be automatically deleted once the linter passes. |
|
API Changes no api changes detected |
🔍 Code Analysis ResultsThis PR fixes a bug in the OpenAPI (OAS) request validation middleware where requests with multiple values for the same header would incorrectly fail validation. The root cause was that the validation library expected a single, comma-separated value for headers like The solution introduces a header normalization step that runs just before validation. This step creates a temporary, normalized version of the request headers:
The changes are accompanied by extensive unit tests for the new normalization logic and an integration test to confirm the end-to-end fix. Files Changed Analysis
Architecture & Impact Assessment
VisualizationThis diagram illustrates how the middleware processes a request with duplicate headers before and after the change. sequenceDiagram
participant Client
participant Gateway
participant ValidateRequestMiddleware as OAS Validator
participant Upstream
Client->>Gateway: GET /path
Header: Accept: text/html
Header: Accept: application/json
Gateway->>OAS Validator: ProcessRequest(originalReq)
Note over OAS Validator: Clones request and normalizes headers
OAS Validator->>OAS Validator: normalizedReq = cloneRequestWithNormalizedHeaders(originalReq)
Note right of OAS Validator: normalizedReq.Header["Accept"] is now "text/html,application/json"
OAS Validator->>OAS Validator: Validate(normalizedReq)
Note right of OAS Validator: Validation succeeds
OAS Validator-->>Gateway: Next()
Gateway->>Upstream: Forward originalReq (unmodified)
Scope Discovery & Context Expansion
Metadata
Powered by Visor from Probelabs Last updated: 2025-11-08T17:40:24.554Z | Triggered by: opened | Commit: 3133a46 💡 TIP: You can chat with Visor using |
🔍 Code Analysis ResultsSecurity Issues (2)
Architecture Issues (2)
Performance Issues (1)
Quality Issues (2)
✅ Dependency Check PassedNo dependency issues found – changes LGTM. ✅ Connectivity Check PassedNo connectivity issues found – changes LGTM. Powered by Visor from Probelabs Last updated: 2025-11-08T17:40:25.531Z | Triggered by: opened | Commit: 3133a46 💡 TIP: You can chat with Visor using |
|



Description
Related Issue
Motivation and Context
How This Has Been Tested
Screenshots (if appropriate)
Types of changes
Checklist
Ticket Details
TT-15160
Generated at: 2025-11-08 17:35:45