Skip to content

Redirect old csv preview urls #4733

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

catalinailie
Copy link
Contributor

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

Trello card https://trello.com/c/kwSXPt3Y/3392-redirect-old-asset-csv-preview-urls

@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4733 April 2, 2025 11:49 Inactive
@catalinailie catalinailie force-pushed the redirect-old-csv-preview-urls branch from 595bc55 to bea909d Compare April 3, 2025 18:12
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4733 April 3, 2025 18:12 Inactive
@catalinailie catalinailie force-pushed the redirect-old-csv-preview-urls branch from bea909d to 31e709d Compare May 20, 2025 10:35
if draft_asset? && served_from_asset_host?
redirect_to(Plek.find("draft-assets") + request.path, allow_other_host: true) and return
if draft_asset? && served_from_origin_host?
redirect_to(Plek.find("draft-origin", external: true) + request.path, allow_other_host: true) and return

Check warning

Code scanning / CodeQL

URL redirection from remote source Medium

Untrusted URL redirection depends on a
user-provided value
.
@catalinailie catalinailie force-pushed the redirect-old-csv-preview-urls branch 4 times, most recently from b602a62 to 96e95a5 Compare May 21, 2025 09:12
@catalinailie catalinailie force-pushed the redirect-old-csv-preview-urls branch 3 times, most recently from 7845b36 to b5dc9f6 Compare June 4, 2025 08:19
@catalinailie catalinailie marked this pull request as ready for review June 4, 2025 14:50
@catalinailie catalinailie force-pushed the redirect-old-csv-preview-urls branch 4 times, most recently from 9435ada to 6024e1c Compare June 6, 2025 12:09
After the new /csv-preview URL is in place, we need to redirect
asset URLs with /media/…/prefix to the new URL.
When a preview for a draft document is accessed from the origin domain,
we want to redirect the url to the draft-origin domain.
eg. https://integration.publishing.service.gov.uk/csv-preview/<id>/<filename>
should be redirected to https://draft-origin.integration.publishing.service.gov.uk/csv-preview/<id>/<filename>
@catalinailie catalinailie force-pushed the redirect-old-csv-preview-urls branch from 73d7de1 to 08b181b Compare June 9, 2025 09:39
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