Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returning non-standard HTTP status code causes exceptions on WebFlux [SPR-16073] #20622

Closed
spring-issuemaster opened this issue Oct 16, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

commented Oct 16, 2017

Anders Aagaard opened SPR-16073 and commented

See https://gist.github.com/andaag/f30aeff3bda499bb159f50649a0eb353

When returning a Mono<ResponseEntity>, and the returned ResponseEntity has a custom http code, spring throws an java.lang.IllegalArgumentException: No matching constant for [555]


Affects: 5.0 GA

Issue Links:

  • #20529 RestTemplate doesn't consistently tolerate unknown HTTP status codes
  • #18779 ResponseEntity should allow the usage of unassigned HTTP status codes
  • #20913 ServerResponse should allow the usage of unassigned HTTP status codes
  • #21289 No support for non-standard HTTP status codes in reactive ClientHttpResponse

Referenced from: commits 3890d4c

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Oct 16, 2017

Juergen Hoeller commented

We've addressed this for Spring MVC and RestTemplate already, so good catch, we need to address this for WebFlux as well.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Oct 16, 2017

Juergen Hoeller commented

AbstractServerHttpResponse can store an HTTP status code as an integer value now, and ResponseEntityResultHandler passes it on as such.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Oct 16, 2017

Anders Aagaard commented

Perfect, thank you very much.

(This is my first bug reported for spring... From initial report to fixed in about 3 hours. I'm pretty happy :p )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.