Skip to content

Commit 41eab1c

Browse files
committed
PATH_INFO shouldn't contain query params
1 parent fc97dac commit 41eab1c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

adafruit_esp32spi/adafruit_esp32spi_wsgiserver.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,14 @@ def _get_environ(self, client):
190190

191191
env["REQUEST_METHOD"] = method
192192
env["SCRIPT_NAME"] = ""
193-
env["PATH_INFO"] = path
194193
env["SERVER_NAME"] = _the_interface.pretty_ip(_the_interface.ip_address)
195194
env["SERVER_PROTOCOL"] = ver
196195
env["SERVER_PORT"] = self.port
197196
if path.find("?") >= 0:
197+
env["PATH_INFO"] = path.split()[0]
198198
env["QUERY_STRING"] = path.split("?")[1]
199+
else:
200+
env["PATH_INFO"] = path
199201

200202
headers = parse_headers(client)
201203
if "content-type" in headers:

0 commit comments

Comments
 (0)