From a604eec8763762f7078992b78b56e6e5304f0559 Mon Sep 17 00:00:00 2001 From: Vytautas Liuolia Date: Sun, 8 Dec 2024 22:05:03 +0100 Subject: [PATCH] docs(testing): add a versionadded note, improve impl --- falcon/testing/helpers.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/falcon/testing/helpers.py b/falcon/testing/helpers.py index 1b858a328..0fc95bc8f 100644 --- a/falcon/testing/helpers.py +++ b/falcon/testing/helpers.py @@ -974,10 +974,16 @@ def create_scope( iterable yielding a series of two-member (*name*, *value*) iterables. Each pair of items provides the name and value for the 'Set-Cookie' header. + + .. versionadded:: 4.1 + The raw (i.e., not URL-decoded) version of the provided `path` is now + preserved in the returned scope as the ``raw_path`` byte string. + According to the ASGI specification, ``raw_path`` **does not include** + any query string. """ http_version = _fixup_http_version(http_version) - raw_path = path.split('?')[0] + raw_path, _, _ = path.partition('?') path = uri.decode(path, unquote_plus=False) # NOTE(kgriffs): Handles both None and ''