-
Notifications
You must be signed in to change notification settings - Fork 41.4k
Closed as not planned
Labels
for: stackoverflowA question that's better suited to stackoverflow.comA question that's better suited to stackoverflow.comstatus: invalidAn issue that we don't feel is validAn issue that we don't feel is valid
Description
Describe the bug
In an application (using Spring Boot 2.7.10) query param is able to override path veriable
Sample
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@RestController
static class HelloController {
public record UrlVariableContainer(String name){}
@GetMapping("/hello/{name}")
public String hello(UrlVariableContainer container) {
return "Hello " + container.name();
}
}
}
Current behaviour:
GET http://localhost:8080/hello/Mat?name=Chad
HTTP/1.1 200
Content-Type: text/plain;charset=UTF-8
Content-Length: 10
Date: Fri, 24 Mar 2023 10:27:17 GMT
Keep-Alive: timeout=60
Connection: keep-alive
Hello Chad
Response code: 200; Time: 8ms (8 ms); Content length: 10 bytes (10 B)
I expected that path variable would not be overrided by query param and response will be "Hello Mat" in this scenario.
Metadata
Metadata
Assignees
Labels
for: stackoverflowA question that's better suited to stackoverflow.comA question that's better suited to stackoverflow.comstatus: invalidAn issue that we don't feel is validAn issue that we don't feel is valid