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 TestClient to preserve raw URI #2159

Merged
merged 2 commits into from Jul 18, 2023
Merged

Conversation

liborjelinek
Copy link
Contributor

@liborjelinek liborjelinek commented Jul 14, 2023

Summary of Changes

When following raw URL recipe based on RAW_URI, it breaks routing with TestClient because TestClient hard-code RAW_URI CGI variable to /.

Related Issues

#2157

Pull Request Checklist

This is just a reminder about the most common mistakes. Please make sure that you tick all appropriate boxes. But please read our contribution guide at least once; it will save you a few review cycles!

If an item doesn't apply to your pull request, check it anyway to make it apparent that there's nothing to do.

  • Applied changes to both WSGI and ASGI code paths and interfaces (where applicable).
  • Added tests for changed code.
  • Prefixed code comments with GitHub nick and an appropriate prefix.
  • Coding style is consistent with the rest of the framework.
  • Updated documentation for changed code.
    • Added docstrings for any new classes, functions, or modules.
    • Updated docstrings for any modifications to existing code.
    • Updated both WSGI and ASGI docs (where applicable).
    • Added references to new classes, functions, or modules to the relevant RST file under docs/.
    • Updated all relevant supporting documentation files under docs/.
    • A copyright notice is included at the top of any new modules (using your own name or the name of your organization).
    • Changed/added classes/methods/functions have appropriate versionadded, versionchanged, or deprecated directives.
  • Changes (and possible deprecations) have towncrier news fragments under docs/_newsfragments/, with the file name format {issue_number}.{fragment_type}.rst. (Run towncrier --draft to ensure it renders correctly.)

If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!

PR template inspired by the attrs project.

@codecov
Copy link

codecov bot commented Jul 14, 2023

Codecov Report

Merging #2159 (074a182) into master (7191be4) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master     #2159   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           62        62           
  Lines         6829      6830    +1     
  Branches      1098      1098           
=========================================
+ Hits          6829      6830    +1     
Impacted Files Coverage Δ
falcon/testing/helpers.py 100.00% <100.00%> (ø)

Copy link
Member

@CaselIT CaselIT left a comment

Choose a reason for hiding this comment

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

thanks!

@CaselIT CaselIT requested a review from vytas7 July 16, 2023 09:24
Copy link
Member

@vytas7 vytas7 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for this fix 👍

(The proposed newsfragment is great in telling the story, but it could probably be made a bit more concise, and tell what actually was fixed; in any case we can circle back on the newsfragments later in a followup PR to make sure the whole changelog looks coherent.)

@vytas7 vytas7 merged commit 69cdcd6 into falconry:master Jul 18, 2023
35 checks passed
@liborjelinek
Copy link
Contributor Author

Thank you for merging. I did it primarily for myself :-) My API heavily relies on correct %2F handling. When will it be approximately released in the PyPI?

vytas7 pushed a commit that referenced this pull request Nov 16, 2023
* fix TestClient to preserve raw URI

* add test and changelog
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

3 participants