Skip to content

Commit a0d4daf

Browse files
committed
test: Add /403-without-body API for other frameworks
1 parent b33897b commit a0d4daf

File tree

5 files changed

+18
-0
lines changed

5 files changed

+18
-0
lines changed

tests/frontendIntegration/django2x/polls/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
path("", views.get_info, name="/"), # type: ignore
1717
path("update-jwt", views.update_jwt, name="update_jwt"), # type: ignore
1818
path("update-jwt-with-handle", views.update_jwt_with_handle, name="update_jwt_with_handle"), # type: ignore
19+
path("403-without-body", views.without_body_403, name="without_body_403"), # type: ignore
1920
path("testing", views.testing, name="testing"), # type: ignore
2021
path("logout", views.logout, name="logout"), # type: ignore
2122
path("revokeAll", views.revoke_all, name="revokeAll"), # type: ignore

tests/frontendIntegration/django2x/polls/views.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,11 @@ def update_jwt_with_handle(request: HttpRequest):
440440
return HttpResponse("")
441441

442442

443+
def without_body_403(request: HttpRequest):
444+
if request.method == "POST":
445+
return HttpResponse("", status=403)
446+
447+
443448
def testing(request: HttpRequest):
444449
if request.method in ["GET", "PUT", "POST", "DELETE"]:
445450
if "testing" in request.headers:

tests/frontendIntegration/django3x/polls/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
path("", views.get_info, name="/"), # type: ignore
1717
path("update-jwt", views.update_jwt, name="update_jwt"), # type: ignore
1818
path("update-jwt-with-handle", views.update_jwt_with_handle, name="update_jwt_with_handle"), # type: ignore
19+
path("403-without-body", views.without_body_403, name="without_body_403"), # type: ignore
1920
path("testing", views.testing, name="testing"), # type: ignore
2021
path("logout", views.logout, name="logout"), # type: ignore
2122
path("revokeAll", views.revoke_all, name="revokeAll"), # type: ignore

tests/frontendIntegration/django3x/polls/views.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,11 @@ async def update_jwt_with_handle(request: HttpRequest):
444444
return HttpResponse("")
445445

446446

447+
async def without_body_403(request: HttpRequest):
448+
if request.method == "POST":
449+
return HttpResponse("", status=403)
450+
451+
447452
async def testing(request: HttpRequest):
448453
if request.method in ["GET", "PUT", "POST", "DELETE"]:
449454
if "testing" in request.headers:

tests/frontendIntegration/flask-server/app.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,12 @@ def update_jwt_with_handle_post():
384384
return resp
385385

386386

387+
@app.route("/403-without-body", methods=["POST"]) # type: ignore
388+
def without_body_403():
389+
# send 403 without body
390+
return "", 403
391+
392+
387393
@app.route("/testing", methods=["OPTIONS"]) # type: ignore
388394
def testing_options():
389395
return send_options_api_response()

0 commit comments

Comments
 (0)