Skip to content

Commit

Permalink
[mini-relay] produce loud errors on unexpected routes
Browse files Browse the repository at this point in the history
  • Loading branch information
asottile-sentry committed Nov 20, 2023
1 parent 8d266cd commit 04a001f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mini-relay/app.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import flask

app = flask.Flask(__name__)
Expand All @@ -9,3 +11,11 @@ def envelope(p: str) -> flask.Response:
ret = app.make_response(('', 204))
ret.access_control_allow_origin = '*'
return ret


@app.post('/<path:path>')
def unhandled(path: str) -> tuple[str, int]:
print('*' * 79)
print(f'unhandled path: {path}')
print('*' * 79)
return '', 400

0 comments on commit 04a001f

Please sign in to comment.