Closed

Description
DESKTOP-J5RVINV ~ # curl -v -i 127.0.0.1:8080 -H "Host: domain.sfm"
* Rebuilt URL to: 127.0.0.1:8080/
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> GET / HTTP/1.1
> Host: domain.sfm
> User-Agent: curl/7.52.1
> Accept: */*
>
< HTTP/1.1 200
HTTP/1.1 200
< Content-Type: text/plain;charset=UTF-8
Content-Type: text/plain;charset=UTF-8
< Content-Length: 11
Content-Length: 11
< Date: Wed, 23 May 2018 00:08:51 GMT
Date: Wed, 23 May 2018 00:08:51 GMT
<
* Curl_http_done: called premature == 0
* Connection #0 to host 127.0.0.1 left intact
Hello world#
DESKTOP-J5RVINV ~ # curl -v -i 127.0.0.1:8080 -H "Host: domain.sf1m"
* Rebuilt URL to: 127.0.0.1:8080/
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> GET / HTTP/1.1
> Host: domain.sf1m
> User-Agent: curl/7.52.1
> Accept: */*
>
< HTTP/1.1 400
HTTP/1.1 400
< Transfer-Encoding: chunked
Transfer-Encoding: chunked
< Date: Wed, 23 May 2018 00:08:55 GMT
Date: Wed, 23 May 2018 00:08:55 GMT
< Connection: close
Connection: close
<
* Curl_http_done: called premature == 0
* Closing connection 0
If the domain .ext contains number, spring boot web always return 400 error code.
My source code
DemoApplication.java
package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
HomeController.java
package com.example.demo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HomeController {
@GetMapping("/")
public String home () {
return "Hello world";
}
}
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
ghost commentedon May 23, 2018
The debug log
ghost commentedon May 23, 2018
ghost commentedon May 23, 2018
Seems the problem belong to tomcat, if we switch to jetty, all things working well
And the log
[-]Spring boot web always return 400 when use a domain name[/-][+][tomcat] Spring boot web always return 400 when use a domain name[/+]ghost commentedon May 23, 2018
Looks like it relate to upstream tomcat issue, i already submit a issue to bz.apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=62399
ghost commentedon May 23, 2018
Temporary solution ,replace tomcat with jetty
Using
Replace
philwebb commentedon May 23, 2018
Thanks, I'll close this one for now and hopefully pick up a fix for Tomcat issue 62399 in due course.
ghost commentedon May 23, 2018
@philwebb hello,
Correct reported version.
The alphabetic restriction for the final segment has been removed in:
*** This bug has been marked as a duplicate of bug 62371 ***
Upstream got response, may we upgrade our tomcat component
philwebb commentedon May 23, 2018
@netroby We have an automated way to pick up dependency upgrades so we should get to those new Tomcat versions in due course.