Skip to content

fix(redirector): improve error handling; switch to 302 redirects#784

Open
palkerecsenyi wants to merge 1 commit intoCERNDocumentServer:masterfrom
palkerecsenyi:redirector-errors
Open

fix(redirector): improve error handling; switch to 302 redirects#784
palkerecsenyi wants to merge 1 commit intoCERNDocumentServer:masterfrom
palkerecsenyi:redirector-errors

Conversation

@palkerecsenyi
Copy link
Copy Markdown
Member

  • Created a new FileNotFound error for when a file cannot be found in any version of a record during the legacy file redirect.
  • Created a template to communicate this to the user a bit more cleanly.
  • Added tests for legacy redirects involving non-existent file names and for soft-deleted records.
  • Added test for restricted record files during legacy redirect
  • Changed legacy redirect HTTP status to 302 instead of 301 to clearly indicate to browsers that the target URL is subject to change (e.g. if a new record version is released) and should therefore not be put in a long-term cache.

Comment thread site/tests/conftest.py Outdated
* Created a new `FileNotFound` error for when a file cannot be found in
any version of a record during the legacy file redirect.
* Created a template to communicate this to the user a bit more cleanly.
* Added tests for legacy redirects involving non-existent file names and
for soft-deleted records.
* Added test for restricted record files during legacy redirect
* Changed legacy redirect HTTP status to 302 instead of 301 to clearly
indicate to browsers that the target URL is subject to change (e.g. if a
new record version is released) and should therefore not be put in a
long-term cache.
Copy link
Copy Markdown
Contributor

@sakshamarora1 sakshamarora1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants