Misleading HTTP Status codes for incorrect paths and methods
See original GitHub issueDescribe the bug
When calling invalid API paths the server responds with 500 Internal server error
.
Expected behaviour
The server responds with a 400 family HTTP status code.
Steps to reproduce the issue
$ curl -v <backend_url>/
[...]
< HTTP/1.1 500
< Content-Type: text/html;charset=utf-8
< Content-Language: en
< Content-Length: 455
< Date: Mon, 18 May 2020 00:00:00 GMT
< Connection: close
<
* Closing connection 0
<!doctype html><html lang="en"><head><title>HTTP Status 500 – Internal Server Error</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 500 – Internal Server Error</h1></body></html>
Technical details
- Host Machine OS (Windows/Linux/Mac): Ubuntu running Docker
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
A Complete Guide and List of HTTP Status Codes - Kinsta
A complete list of HTTP status codes with explaination of what they are, why they occur and what you can do to fix...
Read more >What HTTP status code should be used for wrong input
The 422 (Unprocessable Entity) status code means the server understands the content type of the request entity (hence a 415 (Unsupported Media ...
Read more >HTTP Status Codes For Invalid Data: 400 vs. 422 - Ben Nadel
Ben Nadel looks at the HTTP status codes 400 (Bad Request) and 422 (Unprocessable Entity) and which makes sense for data validation ...
Read more >10 Error Status Codes When Building APIs For The First Time ...
This status code means you haven't yet authenticated against the API. The API doesn't know who you are and it won't serve you....
Read more >HTTP Status Codes List | HTTP Error Codes Explained
Learn about all the HTTP status codes. Read about the HTTP status codes and their descriptions. Quickly understand client and server errors.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Given the fact that 5.4 is still a bit far out, I just reached out the Spring Security team to see whether they can do something about it in the 5.3 branch as well.
can’t reproduce anymore…