Skip to content

Commit

Permalink
Fix untrusted URL redirection warning (#1429)
Browse files Browse the repository at this point in the history
  • Loading branch information
blms committed Aug 22, 2023
1 parent 809ee4e commit a2f43c6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion geniza/corpus/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,10 @@ def form_valid(self, form):
# in case the merge resulted in an error, display error to user
messages.error(self.request, err.message)
# redirect to this form page instead of one of the documents
return HttpResponseRedirect(self.request.get_full_path())
return HttpResponseRedirect(
"%s?ids=%s"
% (reverse("admin:document-merge"), self.request.GET.get("ids", "")),

Check warning

Code scanning / CodeQL

URL redirection from remote source Medium

Untrusted URL redirection depends on a
user-provided value
.
)

# Display info about the merge to the user
new_doc_link = reverse("admin:corpus_document_change", args=[primary_doc.id])
Expand Down

0 comments on commit a2f43c6

Please sign in to comment.