-
Notifications
You must be signed in to change notification settings - Fork 211
Fix redirects if latest version failed to build #509
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
Conversation
So, to double check what this PR does:
Would it be possible to check for the presence of the query string and only include the |
Yes, that's right. I can change it to remove the '?' if there's no query, give me a second. |
Ok should be fixed. |
This comment has been minimized.
This comment has been minimized.
e72902f
to
e662e56
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Closes rust-lang#502 The redirector behaved differently for `/:crate/:version/:target` than for `/:crate/:version/:target/`. This changes the latest version link to use the former, since it properly accounts for failed builds. Additionally, this changes the `/:target` redirect to keep the query parameter so that `?search=` URLs will be kept.
- add query parameter if it exists - don't call `env.frontend()` a dozen times - add tests
e662e56
to
1934869
Compare
This is ready for review. |
r? @kvrhdn |
Sure @jyn514, I should be able to check out these changes this weekend 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, don't have any comments 🙂
Closes #502
The redirector behaved differently for
/:crate/:version/:target
thanfor
/:crate/:version/:target/
. This changes the latest version link touse the former, since it properly accounts for failed builds.
Additionally, this changes the
/:target
redirect to keep the queryparameter so that
?search=
URLs will be kept when going to/:target/
.r? @QuietMisdreavus
Some good crates to test this with: