Remmoves insecure redirects
This should really fundamentally work differently, but this is a quick for for now to avoid an insecure redirect. There will be a negative impact on user experience from this, and a followup change should look into these views and improve their flow.
This commit is contained in:
parent
e3dbe5a142
commit
661865de87
6 changed files with 19 additions and 21 deletions
|
@ -82,7 +82,7 @@ class CreateStatus(View):
|
|||
if is_api_request(request):
|
||||
logger.exception(form.errors)
|
||||
return HttpResponseBadRequest()
|
||||
return redirect(request.headers.get("Referer", "/"))
|
||||
return redirect("/")
|
||||
|
||||
status = form.save(commit=False)
|
||||
# save the plain, unformatted version of the status for future editing
|
||||
|
@ -146,7 +146,7 @@ class DeleteStatus(View):
|
|||
|
||||
# perform deletion
|
||||
status.delete()
|
||||
return redirect(request.headers.get("Referer", "/"))
|
||||
return redirect("/")
|
||||
|
||||
|
||||
@login_required
|
||||
|
@ -195,7 +195,7 @@ def edit_readthrough(request):
|
|||
|
||||
if is_api_request(request):
|
||||
return HttpResponse()
|
||||
return redirect(request.headers.get("Referer", "/"))
|
||||
return redirect("/")
|
||||
|
||||
|
||||
def find_mentions(content):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue