Skip to content

Commit

Permalink
handle cors preflight without auth (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
bolyachevets authored Apr 10, 2024
1 parent 2630f97 commit 7d0a59a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions notify-api/src/notify_api/resources/v2/safe_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
bp = Blueprint("SAFE_LIST", __name__, url_prefix="/safe_list")


@bp.route("/", methods=["POST", "OPTIONS"])
@bp.route("/", methods=["POST"])
@jwt.requires_auth
@jwt.has_one_of_roles([Role.SYSTEM.value, Role.STAFF.value])
@validate()
Expand All @@ -40,7 +40,14 @@ def safe_list(body: SafeListRequest): # pylint: disable=unused-argument
return {}, HTTPStatus.OK


@bp.route("/", methods=["GET", "OPTIONS"])
@bp.route("/", methods=["OPTIONS"])
@validate()
def get_safe_list_preflight():
"""Handle safe list cors preflight."""
return {}, HTTPStatus.OK


@bp.route("/", methods=["GET"])
@jwt.requires_auth
@jwt.has_one_of_roles([Role.SYSTEM.value, Role.STAFF.value])
@validate()
Expand Down

0 comments on commit 7d0a59a

Please sign in to comment.