Fail suspected API requests with 404, not 503

Non-running user servers making requests is a fairly
common occurance - user servers get culled while their
browser tabs are left open. So we now have a background level
of 503s responses on the hub *all* the time, making it
very difficult to detect *real* 503s, which should ideally
be closely monitored and alerted on.

I *think* 404 is a more appropriate response, as the resource
(API) being requested is no longer present.
This commit is contained in:
YuviPanda
2021-10-05 02:30:52 +05:30
parent af1686dbe6
commit 0f471f4e12
2 changed files with 2 additions and 2 deletions

View File

@@ -1349,7 +1349,7 @@ class UserUrlHandler(BaseHandler):
self.log.warning(
"Failing suspected API request to not-running server: %s", self.request.path
)
self.set_status(503)
self.set_status(404)
self.set_header("Content-Type", "application/json")
spawn_url = urlparse(self.request.full_url())._replace(query="")