Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make redirects permanent #379

Merged
merged 4 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion process_request/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ def test_linkresolver_view(self, mock_resolve):
mock_refid = "12345abcdef"
mock_resolve.return_value = mock_uri
response = self.client.get(reverse('resolve-request'), {"ref_id": mock_refid})
self.assertEqual(response.status_code, 302)
self.assertEqual(response.status_code, 301)
self.assertEqual(response.url, f"{settings.DIMES_BASEURL}{mock_uri}")
mock_resolve.assert_called_with(settings.ARCHIVESSPACE["repo_id"], mock_refid, ANY)

Expand Down
2 changes: 1 addition & 1 deletion process_request/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def get(self, request):
host = settings.DIMES_BASEURL
repo = settings.ARCHIVESSPACE["repo_id"]
uri = resolve_ref_id(repo, data, aspace.client)
response = redirect("{}{}".format(host, uri))
response = redirect("{}{}".format(host, uri), permanent=True)
return response
except Exception as e:
return Response({"detail": str(e)}, status=500)
Expand Down
Loading