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

Support redirecting to asset preview URLs #1678

Merged
merged 1 commit into from
Mar 9, 2020

Conversation

thomasleese
Copy link
Contributor

Currently the route for assets assumes that it ends with a file extension (for example .pdf). In the case of the preview URLs (which end with /preview) it thinks the format of the page is .pdf/preview. This gets URL encoded into .pdf%2Fpreview by Rails and so the redirect doesn't work.

Rather than handling the file extension special, this PR changes it to accept any path containing any number of file extensions or slashes in no particular format.

Currently the route for assets assumes that it ends with a file
extension (for example `.pdf`). In the case of the preview URLs (which
end with `/preview`) it thinks the format of the page is `.pdf/preview`.
This gets URL encoded into `.pdf%2Fpreview` by Rails and so the redirect
doesn't work.

Rather than handling the file extension special, this PR changes it to
accept any path containing any number of file extensions or slashes in
no particular format.
@bevanloon bevanloon temporarily deployed to government-f-assets-pre-tim9fe March 9, 2020 10:50 Inactive
@thomasleese thomasleese requested a review from cbaines March 9, 2020 10:51
@thomasleese thomasleese merged commit c5a6f6d into master Mar 9, 2020
@thomasleese thomasleese deleted the assets-preview-redirect branch March 9, 2020 11:35
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.

3 participants