Skip to content

Commit 50cdb58

Browse files
committed
Remove request._get_full_path
1 parent 544f3e1 commit 50cdb58

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

plain/plain/http/request.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,12 @@ def port(self):
151151
return str(port)
152152

153153
def get_full_path(self, force_append_slash=False):
154-
return self._get_full_path(self.path, force_append_slash)
154+
"""
155+
Return the full path for the request, including query string.
155156
156-
def _get_full_path(self, path, force_append_slash):
157+
If force_append_slash is True, append a trailing slash if the path
158+
doesn't already end with one.
159+
"""
157160
# RFC 3986 requires query string arguments to be in the ASCII range.
158161
# Rather than crash if this doesn't happen, we encode defensively.
159162

@@ -174,8 +177,8 @@ def escape_uri_path(path):
174177
return quote(path, safe="/:@&+$,-_.!~*'()")
175178

176179
return "{}{}{}".format(
177-
escape_uri_path(path),
178-
"/" if force_append_slash and not path.endswith("/") else "",
180+
escape_uri_path(self.path),
181+
"/" if force_append_slash and not self.path.endswith("/") else "",
179182
("?" + iri_to_uri(self.meta.get("QUERY_STRING", "")))
180183
if self.meta.get("QUERY_STRING", "")
181184
else "",

0 commit comments

Comments
 (0)