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

disallow query or fragements in url_for constructions #2430

Merged
merged 3 commits into from
Dec 5, 2021

Conversation

aliemjay
Copy link
Member

@aliemjay aliemjay commented Oct 31, 2021

PR Type

Improvement

PR Checklist

  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • A changelog entry has been made for the appropriate packages.
  • Format code with the latest stable rustfmt.
  • (Team) Label with affected crates and semver status.

Overview

Previously url_for could output a url with query and fragment components. This is changed now so that it escapes ? and #.

The rationale is that req.url_for(_, req.match_info().iter()) should output the original request path, and since dynamic segments percent-decode ? and #, url_for should escape them.

@robjtede robjtede added A-web project: actix-web B-semver-patch labels Oct 31, 2021
@robjtede robjtede added this to the actix-web v4 milestone Nov 24, 2021
@robjtede robjtede changed the title redefine url_for parser behavior disallow query or fragements in url_for constructions Dec 5, 2021
@robjtede robjtede merged commit 59be0c6 into actix:master Dec 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-web project: actix-web B-semver-patch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants