Skip to content

Commit

Permalink
prevent redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
CalebCourier committed Feb 27, 2024
1 parent d6d5d5e commit 821cecd
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __call__(self, environ, start_response):

def create_app():
app = Flask(__name__)

@app.before_request
def trace_requests_before():
print(f"Request {request.endpoint or request.url or request.path} received!")
Expand All @@ -30,7 +30,7 @@ def trace_requests_before():
def trace_requests_after(response: Response):
print(f"Responding to request with status: {response.status}")
return response

app.config["PREFERRED_URL_SCHEME"] = "https"
ReverseProxied(app)
CORS(app)
Expand Down
2 changes: 1 addition & 1 deletion src/blueprints/guards.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
guard_client = GuardClient()


@guards_bp.route("/", methods=["GET", "POST"])
@guards_bp.route("", methods=["GET", "POST"])
@handle_error
@gather_request_metrics
def guards():
Expand Down
2 changes: 0 additions & 2 deletions src/blueprints/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,5 @@ def docs():
</script>
</body>
</html>""").safe_substitute(apiDocUrl=f"{host}/api-docs") # noqa

# <script nonce="{{ csp_nonce() }}">

return flask.render_template_string(swagger_ui)
2 changes: 1 addition & 1 deletion tests/blueprints/test_guards.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_guards_get(mocker):
response = guards()

assert guards_bp.route_call_count == 3
assert guards_bp.routes == ["/", "/<guard_name>", "/<guard_name>/validate"]
assert guards_bp.routes == ["", "/<guard_name>", "/<guard_name>/validate"]

assert get_guards_spy.call_count == 1

Expand Down

0 comments on commit 821cecd

Please sign in to comment.