Skip to content

Commit

Permalink
Merge pull request #12 from dabapps/change-response-code-when-no-back…
Browse files Browse the repository at this point in the history
…end-found

Change response code to 502 when no backend found
  • Loading branch information
jordaneb authored Sep 2, 2019
2 parents e78a74d + 9d0a68d commit cad62b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion router.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def proxy(path):
hostname = urlparse(request.base_url).hostname
if hostname not in routes:
app.logger.warn(f"No backend for {hostname}")
abort(404)
abort(502)

path = request.full_path if request.args else request.path
target_url = f"http://localhost:{routes[hostname]}{path}"
Expand Down

0 comments on commit cad62b7

Please sign in to comment.