Skip to content

WSGI middleware should unquote path_info #89

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 1 commit into from
Mar 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions azure/functions/_http_wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import logging
from io import BytesIO, StringIO
from os import linesep
from urllib.parse import urlparse
from urllib.parse import urlparse, unquote_to_bytes
from wsgiref.headers import Headers

from ._abc import Context
Expand All @@ -30,7 +30,7 @@ def __init__(self,
# Implement interfaces for PEP 3333 environ
self.request_method = getattr(func_req, 'method', None)
self.script_name = ''
self.path_info = getattr(url, 'path', None)
self.path_info = unquote_to_bytes(getattr(url, 'path', None)).decode('latin-1')
self.query_string = getattr(url, 'query', None)
self.content_type = self._lowercased_headers.get('content-type')
self.content_length = str(len(func_req_body))
Expand Down