From 8b1c6bcd06237bc0175b085d9a66acd946844334 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Thu, 18 Apr 2024 20:33:25 -0500 Subject: [PATCH] Issue #11659 - Properly ignore OWS before field values. (#11661) * implemented changes to CACHE and parseFields to handle OWS properly for all UNMATCHED_VALUE headers. * added 3 new OWS test cases (that fail in 12.0.x HEAD btw) to handle this OWS case. --- .../org/eclipse/jetty/http/HttpParser.java | 36 +++--- .../eclipse/jetty/http/HttpParserTest.java | 113 +++++++++++++++++- 2 files changed, 132 insertions(+), 17 deletions(-) diff --git a/jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java b/jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java index f7907a83f765..810c8f11c7c8 100644 --- a/jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java +++ b/jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java @@ -95,6 +95,7 @@ public class HttpParser public static final Logger LOG = LoggerFactory.getLogger(HttpParser.class); public static final int INITIAL_URI_LENGTH = 256; private static final int MAX_CHUNK_LENGTH = Integer.MAX_VALUE / 16 - 16; + private static final String UNMATCHED_VALUE = "\u0000"; /** * Cache of common {@link HttpField}s including: