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

Fix validate_redirects.py to handle absolute paths #6042

Merged
merged 1 commit into from
Sep 25, 2020

Conversation

chosak
Copy link
Member

@chosak chosak commented Sep 25, 2020

The current redirects validation script (validate_redirects.py) assumes that the server responds with redirects pointing to relative paths, like Django returns. Apache instead returns absolute paths, which fails the script. This change makes it so that the script properly handles either case.

How to test this PR

You can test this using an input spreadsheet that includes an Apache-served redirect; internally this can be demonstrated now on UCP stack 6024.

Checklist

  • PR has an informative and human-readable title
    • PR titles are used to generate the change log in releases; good ones make that easier to scan.
    • Consider prefixing, e.g., "Mega Menu: fix layout bug", or "Docs: Update Docker installation instructions".
  • Changes are limited to a single goal (no scope creep)
  • Code follows the standards laid out in the CFPB development guidelines

The current redirects validation script (validate_redirects.py) assumes
that the server responds with redirects pointing to relative paths, like
Django returns. Apache instead returns absolute paths, which fails the
script. This change makes it so that the script properly handles either
case.
Copy link
Member

@wpears wpears left a comment

Choose a reason for hiding this comment

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

This code is very sneaky

@chosak chosak merged commit f245f6e into main Sep 25, 2020
@chosak chosak deleted the fix/validate-redirects-absolute branch September 25, 2020 18:29
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.

None yet

2 participants