question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Misleading HTTP Status codes for incorrect paths and methods

See original GitHub issue

Describe 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
odrotbohmcommented, Jul 25, 2020

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.

0reactions
hilmarfcommented, Nov 20, 2020

can’t reproduce anymore…

curl -v https://submission.coronawarn.app/
< HTTP/1.1 403
...
< Date: Fri, 20 Nov 2020 13:52:51 GMT
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found