Skip to content

middleware::log_request: Move OriginalPath code into NormalizePath middleware #4124

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

Merged
merged 3 commits into from
Nov 6, 2021

Conversation

Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Nov 3, 2021

The NormalizePath middleware is the one that mutates the path, so it should also be responsible for saving the original one, if necessary.

This PR slightly changes the logic in that OriginalPath is only added to the request extensions if the path has been changed. The NormalizePath middleware now defaults to request.path(), if OriginalPath is not found in the request extensions.

@Turbo87 Turbo87 added C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear A-backend ⚙️ labels Nov 3, 2021
@Turbo87 Turbo87 requested review from JohnTitor and locks November 3, 2021 14:16
Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

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

Makes sense to me, feel free to r=me once the comment below is addressed.

@Turbo87
Copy link
Member Author

Turbo87 commented Nov 6, 2021

@bors r=JohnTitor

@bors
Copy link
Contributor

bors commented Nov 6, 2021

📌 Commit 362f80d has been approved by JohnTitor

@bors
Copy link
Contributor

bors commented Nov 6, 2021

⌛ Testing commit 362f80d with merge daeb9fb...

@bors
Copy link
Contributor

bors commented Nov 6, 2021

☀️ Test successful - checks-actions
Approved by: JohnTitor
Pushing daeb9fb to master...

@bors bors merged commit daeb9fb into rust-lang:master Nov 6, 2021
@Turbo87 Turbo87 deleted the original-path branch November 6, 2021 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backend ⚙️ C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants