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

Correct WSGI adapter handling of root path. #446

Merged
merged 1 commit into from Mar 15, 2024

Conversation

carltongibson
Copy link
Member

Fixes #442

script_name = scope.get("root_path", "").encode("utf8").decode("latin1")
path_info = scope["path"].encode("utf8").decode("latin1")
if path_info.startswith(script_name):
path_info = path_info[len(script_name) :]
Copy link
Member Author

Choose a reason for hiding this comment

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

The setup.cfg change was required by this.

% flake8 asgiref/wsgi.py 
asgiref/wsgi.py:60:51: E203 whitespace before ':'

@carltongibson carltongibson merged commit 4209b6c into main Mar 15, 2024
6 checks passed
@carltongibson carltongibson deleted the wsgi-adapter-root-path branch March 15, 2024 16:17
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.

PATH_INFO set incorrectly by WsgiToAsgiInstance.build_environ()
2 participants