Skip to content

200 response is returned when ObservationMarkingRequestRejectedHandler is in use #12548

@philwebb

Description

@philwebb

Describe the bug
When using Micrometer Observability the following code configures an ObservationMarkingRequestRejectedHandler:

.setRequestRejectedHandler(new ObservationMarkingRequestRejectedHandler(this.observationRegistry));

This handler replaces the HttpStatusRequestRejectedHandler which means that 200 responses get returned instead of 400.

To Reproduce
Run https://github.com/philwebb/whats-new-in-spring-boot-3-0 and hit a URL with two slashes.

$ http localhost:8080/dog///
HTTP/1.1 200 
Connection: keep-alive
Content-Length: 0
Date: Fri, 13 Jan 2023 23:22:39 GMT
Keep-Alive: timeout=60

Expected behavior
The above should return 400

Sample
(not minimal)

Run https://github.com/philwebb/whats-new-in-spring-boot-3-0

Metadata

Metadata

Assignees

Labels

in: configAn issue in spring-security-configtype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions