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

Extract utility functions from wsgi.py #2415

Merged
merged 1 commit into from
Jul 22, 2022

Conversation

rrahkola
Copy link
Contributor

@rrahkola rrahkola commented May 3, 2022

This is a step towards supporting ASGI. Utility functions in the top-level wsgi.py module are extracted into the sansio/utils.py module.

The following functions were extracted:

  • get_content_length
  • get_query_string
  • get_path_info

The following functions were ignored:

Checklist:

  • Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
  • Add or update relevant docs, in the docs folder and in code.
  • Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • Add .. versionchanged:: entries in any relevant code docs.
  • Run pre-commit hooks and fix any issues.
  • Run pytest and tox, no tests failed.

This is to make these functions available to non-WSGI uses.
@pgjones pgjones merged commit 81d2ed0 into pallets:main Jul 22, 2022
@davidism davidism added this to the 2.2.0 milestone Jul 22, 2022
dairiki added a commit to dairiki/lektor that referenced this pull request Jul 24, 2022
dairiki added a commit to lektor/lektor that referenced this pull request Jul 24, 2022
* Fix for werkzeug 2.2.0

The `any` route converter has apparently stopped working correctly if one of the choices is the empty string.

* Use shift_path_info from wsgiref instead of werkzeug's pop_path_info

Pop_path_info has been deprecated. (See pallets/werkzeug#2415.)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor WSGI assumptions out of http.py and wsgi.py functions
3 participants