dyrnq / springboot-httpbin

A java(springboot) port of the venerable httpbin.org HTTP request & response testing service.
https://hub.docker.com/r/dyrnq/springboot-httpbin
MIT License
1 stars 0 forks source link

java.lang.IllegalArgumentException: UT000173: An invalid control character [239] was present in the cookie value or attribute #8

Open dyrnq opened 1 month ago

dyrnq commented 1 month ago
java.lang.IllegalArgumentException: UT000173: An invalid control character [239] was present in the cookie value or attribute
    at io.undertow.util.LegacyCookieSupport.isHttpSeparator(LegacyCookieSupport.java:149) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.util.Cookies.parseCookie(Cookies.java:304) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.util.Cookies.parseRequestCookies(Cookies.java:246) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.util.Cookies.parseRequestCookies(Cookies.java:224) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.util.Cookies.parseRequestCookies(Cookies.java:215) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.server.HttpServerExchange.requestCookies(HttpServerExchange.java:1207) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.server.HttpServerExchange.getRequestCookie(HttpServerExchange.java:1188) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.server.session.SessionCookieConfig.findSessionId(SessionCookieConfig.java:83) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.servlet.spec.SessionCookieConfigImpl.findSessionId(SessionCookieConfigImpl.java:76) ~[undertow-servlet-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.servlet.spec.ServletContextImpl$ServletContextSessionConfig.findSessionId(ServletContextImpl.java:1277) ~[undertow-servlet-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.server.session.InMemorySessionManager.getSession(InMemorySessionManager.java:240) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.servlet.spec.ServletContextImpl.getSession(ServletContextImpl.java:884) ~[undertow-servlet-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.servlet.spec.ServletContextImpl.getSession(ServletContextImpl.java:990) ~[undertow-servlet-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:69) ~[undertow-servlet-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.servlet.handlers.SendErrorPageHandler.handleRequest(SendErrorPageHandler.java:52) ~[undertow-servlet-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:276) ~[undertow-servlet-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135) ~[undertow-servlet-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:132) ~[undertow-servlet-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) ~[undertow-servlet-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) ~[undertow-servlet-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:256) ~[undertow-servlet-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:101) ~[undertow-servlet-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:395) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:859) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18) ~[jboss-threads-3.5.0.Final.jar!/:3.5.0.Final]
    at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513) ~[jboss-threads-3.5.0.Final.jar!/:3.5.0.Final]
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538) ~[jboss-threads-3.5.0.Final.jar!/:3.5.0.Final]
    at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282) ~[xnio-api-3.8.16.Final.jar!/:3.8.16.Final]
    at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]

2024-09-28T13:56:35.880Z ERROR 1 --- [  XNIO-1 task-4] io.undertow.request                      : UT005023: Exception handling request to /cookies/set/key/key

java.lang.IllegalArgumentException: UT000173: An invalid control character [239] was present in the cookie value or attribute
    at io.undertow.util.LegacyCookieSupport.isHttpSeparator(LegacyCookieSupport.java:149) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.util.Cookies.parseCookie(Cookies.java:304) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.util.Cookies.parseRequestCookies(Cookies.java:246) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.util.Cookies.parseRequestCookies(Cookies.java:224) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.util.Cookies.parseRequestCookies(Cookies.java:215) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.server.HttpServerExchange.requestCookies(HttpServerExchange.java:1207) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.server.HttpServerExchange.getRequestCookie(HttpServerExchange.java:1188) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.server.session.SessionCookieConfig.findSessionId(SessionCookieConfig.java:83) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.servlet.spec.SessionCookieConfigImpl.findSessionId(SessionCookieConfigImpl.java:76) ~[undertow-servlet-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.servlet.spec.ServletContextImpl$ServletContextSessionConfig.findSessionId(ServletContextImpl.java:1277) ~[undertow-servlet-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.server.session.InMemorySessionManager.getSession(InMemorySessionManager.java:240) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.servlet.spec.ServletContextImpl.getSession(ServletContextImpl.java:884) ~[undertow-servlet-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.servlet.spec.ServletContextImpl.getSession(ServletContextImpl.java:990) ~[undertow-servlet-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:69) ~[undertow-servlet-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.servlet.handlers.SendErrorPageHandler.handleRequest(SendErrorPageHandler.java:52) ~[undertow-servlet-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:276) ~[undertow-servlet-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135) ~[undertow-servlet-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:132) ~[undertow-servlet-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) ~[undertow-servlet-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) ~[undertow-servlet-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:256) ~[undertow-servlet-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:101) ~[undertow-servlet-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:395) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:859) ~[undertow-core-2.3.17.Final.jar!/:2.3.17.Final]
    at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18) ~[jboss-threads-3.5.0.Final.jar!/:3.5.0.Final]
    at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513) ~[jboss-threads-3.5.0.Final.jar!/:3.5.0.Final]
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538) ~[jboss-threads-3.5.0.Final.jar!/:3.5.0.Final]
    at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282) ~[xnio-api-3.8.16.Final.jar!/:3.8.16.Final]
    at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]

xref https://github.com/renaesop/blog/issues/4

dyrnq commented 1 month ago
java.lang.IllegalArgumentException: The Unicode character [的] at code point [30,340] cannot be encoded as it is outside the permitted range of 0 to 255
    at org.apache.tomcat.util.buf.MessageBytes.toBytesSimple(MessageBytes.java:310) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.tomcat.util.buf.MessageBytes.toBytes(MessageBytes.java:283) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.coyote.http11.Http11OutputBuffer.write(Http11OutputBuffer.java:400) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.coyote.http11.Http11OutputBuffer.sendHeader(Http11OutputBuffer.java:379) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.coyote.http11.Http11Processor.writeHeaders(Http11Processor.java:1048) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.coyote.http11.Http11Processor.prepareResponse(Http11Processor.java:1035) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.coyote.AbstractProcessor.action(AbstractProcessor.java:377) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.coyote.Response.action(Response.java:210) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.coyote.Response.commit(Response.java:464) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:285) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:244) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.catalina.connector.Response.finishResponse(Response.java:421) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:373) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:384) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:905) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1741) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1190) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]

2024-09-28T14:10:04.069Z  WARN 1 --- [nio-8080-exec-6] o.apache.coyote.http11.Http11Processor   : The HTTP response header [Set-Cookie] with value [的的=的的; Path=/] has been removed from the response because it is invalid

java.lang.IllegalArgumentException: The Unicode character [的] at code point [30,340] cannot be encoded as it is outside the permitted range of 0 to 255
    at org.apache.tomcat.util.buf.MessageBytes.toBytesSimple(MessageBytes.java:310) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.tomcat.util.buf.MessageBytes.toBytes(MessageBytes.java:283) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.coyote.http11.Http11OutputBuffer.write(Http11OutputBuffer.java:400) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.coyote.http11.Http11OutputBuffer.sendHeader(Http11OutputBuffer.java:379) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.coyote.http11.Http11Processor.writeHeaders(Http11Processor.java:1048) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.coyote.http11.Http11Processor.prepareResponse(Http11Processor.java:1035) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.coyote.AbstractProcessor.action(AbstractProcessor.java:377) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.coyote.Response.action(Response.java:210) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.coyote.Response.commit(Response.java:464) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:285) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:244) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.catalina.connector.Response.finishResponse(Response.java:421) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:373) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:384) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:905) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1741) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1190) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63) ~[tomcat-embed-core-10.1.30.jar!/:na]
    at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]