Hi Stuart, I whipped up a very simple standalone use case that demonstrates the issue. I created a class with the following code:
import io.undertow.Undertow;
import io.undertow.util.Headers;
import io.undertow.util.HeaderValues;
public class UndertowSample {
public static void main(String[] args) {
Undertow server = Undertow.builder()
.addHttpListener(8080, "localhost")
.setHandler(exchange -> {
exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "text/html");
String response = "Here are the headers:<br>";
HeaderValues lowerHeader = exchange.getRequestHeaders().get("test-header");
if( lowerHeader != null ) {
response += "Number of 'test-header' headers found: " + lowerHeader.size() + "<br>";
response += "Values: " + lowerHeader.toString() + "<br>";
}
HeaderValues upperHeader = exchange.getRequestHeaders().get("TEST-HEADER");
if( upperHeader != null ) {
response += "Number of 'TEST-HEADER' headers found: " + upperHeader.size() + "<br>";
response += "Values: " + upperHeader.toString() + "<br>";
}
exchange.getResponseSender().send(response);
}).build();
server.start();
}
}
I compiled the class and ran it, starting the server. First I hit the server via PostMan with two headers of the same case and the output correctly shows both headers processed and available in Undertow regardless of whether they are accessed via uppercase or lowercase:
Next, I uppercased ONE of the header names and you can see that Undertow now only processes a single header, losing one of the values. I only get back the second header value regardless of what case I use to access it.
Let me know if you're able to reproduce the issue with my test code above.