i create a simple application ,properties file like below

server.address=0.0.0.0
server.port=12306
server.servlet.context-path=/test-spring
logging.level.root=debug
logging.file.name=/var/log/test-spring/test-spring.log

when i try curl http://127.0.0.1:12306/test-spring/ --> 404 it is ok; but curl http://127.0.0.1:12306/test-spring return nothing;

log is

o.apache.coyote.http11.Http11Processor   : Error parsing HTTP request header

java.io.EOFException: null
    at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1345) ~[tomcat-embed-core-9.0.45.jar!/:na]
    at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1255) ~[tomcat-embed-core-9.0.45.jar!/:na]
    at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:794) ~[tomcat-embed-core-9.0.45.jar!/:na]
    at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:359) ~[tomcat-embed-core-9.0.45.jar!/:na]
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:261) ~[tomcat-embed-core-9.0.45.jar!/:na]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-embed-core-9.0.45.jar!/:na]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893) [tomcat-embed-core-9.0.45.jar!/:na]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1707) [tomcat-embed-core-9.0.45.jar!/:na]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.45.jar!/:na]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_40]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_40]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.45.jar!/:na]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_40]

my os is Linux version 4.18.0-147.8.1.el8_1.x86_64 ;on windows 10 ,everything is fine

Comment From: esotericman

both version 2.4.5 and 2.3.2.RELEASE show this error

Comment From: wilkinsona

Thanks for the report, but I cannot reproduce the behaviour that you have described:

$ curl -v http://localhost:12306/test-spring/
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 12306 (#0)
> GET /test-spring/ HTTP/1.1
> Host: localhost:12306
> User-Agent: curl/7.64.1
> Accept: */*
> 
< HTTP/1.1 404 
< Vary: Origin
< Vary: Access-Control-Request-Method
< Vary: Access-Control-Request-Headers
< Content-Type: application/json
< Transfer-Encoding: chunked
< Date: Tue, 11 May 2021 16:54:59 GMT
< 
* Connection #0 to host localhost left intact
{"timestamp":"2021-05-11T16:54:59.702+00:00","status":404,"error":"Not Found","message":"","path":"/test-spring/"}* Closing connection 0
$ curl -v http://localhost:12306/test-spring 
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 12306 (#0)
> GET /test-spring HTTP/1.1
> Host: localhost:12306
> User-Agent: curl/7.64.1
> Accept: */*
> 
< HTTP/1.1 302 
< Location: http://localhost:12306/test-spring/
< Transfer-Encoding: chunked
< Date: Tue, 11 May 2021 16:54:56 GMT
< 
* Connection #0 to host localhost left intact
* Closing connection 0

Following the redirect in the second case also works:

$ curl -vL http://localhost:12306/test-spring
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 12306 (#0)
> GET /test-spring HTTP/1.1
> Host: localhost:12306
> User-Agent: curl/7.64.1
> Accept: */*
> 
< HTTP/1.1 302 
< Location: http://localhost:12306/test-spring/
< Transfer-Encoding: chunked
< Date: Tue, 11 May 2021 16:56:18 GMT
< 
* Ignoring the response-body
* Connection #0 to host localhost left intact
* Issue another request to this URL: 'http://localhost:12306/test-spring/'
* Found bundle for host localhost: 0x7f8e1ac1c750 [can pipeline]
* Could pipeline, but not asked to!
* Re-using existing connection! (#0) with host localhost
* Connected to localhost (::1) port 12306 (#0)
> GET /test-spring/ HTTP/1.1
> Host: localhost:12306
> User-Agent: curl/7.64.1
> Accept: */*
> 
< HTTP/1.1 404 
< Vary: Origin
< Vary: Access-Control-Request-Method
< Vary: Access-Control-Request-Headers
< Content-Type: application/json
< Transfer-Encoding: chunked
< Date: Tue, 11 May 2021 16:56:18 GMT
< 
* Connection #0 to host localhost left intact
{"timestamp":"2021-05-11T16:56:18.935+00:00","status":404,"error":"Not Found","message":"","path":"/test-spring/"}* Closing connection 0

On Linux, it looks like an incorrectly formed request is being sent to Tomcat. This is out of Spring Boot's control. You could check that you are using an up-to-date version of curl on Linux and perhaps use -v to see exactly what it's sending to the server.

I'm going to close this issue as I can't see any sign of a problem with Spring Boot. If you have evidence to the contrary and you would like us to spend some more time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.

Comment From: esotericman

both version 2.4.5 and 2.3.2.RELEASE show this error

thanks,my matter