-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Description
This is not possible to add several times the same header name, we get following exception:
2025-01-30 08:56:28.965 WARNING pool-2-thread-1 robaho.net.httpserver.ServerImpl$Exchange run [http:9101] ServerImpl unexpected exception
java.lang.UnsupportedOperationException
at java.base/java.util.AbstractList.add(AbstractList.java:155)
at java.base/java.util.AbstractList.add(AbstractList.java:113)
at robaho.httpserver/robaho.net.httpserver.OptimizedHeaders.add(OptimizedHeaders.java:97)
at robaho.httpserver/robaho.net.httpserver.Request.headers(Request.java:202)
at robaho.httpserver/robaho.net.httpserver.ServerImpl$Exchange.runPerRequest(ServerImpl.java:713)
at robaho.httpserver/robaho.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:626)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
Note that when using the jdk httpserver this problem does not occur.
I have investigated the code and found the problem in method robaho.net.httpserver.OptimizedHeaders.add
I have added a test reproducing the problem and implemented a fix: I will make a pull request with a proposal.
Metadata
Metadata
Assignees
Labels
No labels