Skip to content

Parse URL for rustlang.org redirector once. #456

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

de-vri-es
Copy link
Contributor

A colleague of mine pointed out that the rustlang redirector could have parsed the URL once in the new function. She was right, so this PR moves the URL building from the handle function to the new function.

Even though the parsing/joining/converting can't really fail, now at-least it would do so at startup, rather than during a request. And it's technically more efficient, even though I'm pretty sure nobody will ever notice.

Copy link
Member

@QuietMisdreavus QuietMisdreavus left a comment

Choose a reason for hiding this comment

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

Nice catch, thanks so much!

@QuietMisdreavus QuietMisdreavus merged commit d29b3b8 into rust-lang:master Oct 31, 2019
@m-ou-se m-ou-se deleted the rustlang-redirector-parse-once branch October 31, 2019 16:07
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