Skip to content

Commit

Permalink
Fixed header cache for unknown values
Browse files Browse the repository at this point in the history
Avoid adding the unknown marker into the CACHE index. Issue introduced in #11661 fixing #11659
  • Loading branch information
gregw committed May 19, 2024
1 parent d79a0a8 commit 69ad90f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ public class HttpParser
{
HttpField httpField = new HttpField(h, UNMATCHED_VALUE);
map.put(h + ": ", httpField);
map.put(h + ":", httpField);
}
return map;
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,6 @@ public void testHeaderCache()
assertThat(HttpParser.CACHE.getBest("Content-Type: unknown\n").toString(), is("Content-Type: \u0000"));
assertThat(HttpParser.CACHE.getBest("content-type: unknown\r\n").toString(), is("Content-Type: \u0000"));
assertThat(HttpParser.CACHE.getBest("content-type: unknown\n").toString(), is("Content-Type: \u0000"));

assertThat(HttpParser.CACHE.getBest("Content-Type:text/plain\r\n").toString(), is("Content-Type: \u0000"));
assertThat(HttpParser.CACHE.getBest("Content-Type:text/plain\n").toString(), is("Content-Type: \u0000"));
assertThat(HttpParser.CACHE.getBest("content-type:unknown\r\n").toString(), is("Content-Type: \u0000"));
assertThat(HttpParser.CACHE.getBest("content-type:unknown\n").toString(), is("Content-Type: \u0000"));
}

@ParameterizedTest
Expand Down

0 comments on commit 69ad90f

Please sign in to comment.