diff options
| author | Jonas Haag <jonas@lophus.org> | 2017-11-07 21:58:05 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-11-07 15:58:05 -0500 |
| commit | a2851f204c6431330042d0343ee99f33449f78e0 (patch) | |
| tree | b478da949234c74a6818b1740f82237453527bf9 /django/http/request.py | |
| parent | 3e7497a05e7f7cf0ff157d88cef18e95e3cff57b (diff) | |
Fixed #28720 -- Added HttpRequest.get_full_path_info().
Diffstat (limited to 'django/http/request.py')
| -rw-r--r-- | django/http/request.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/django/http/request.py b/django/http/request.py index 28eae377a9..5a14c2a41a 100644 --- a/django/http/request.py +++ b/django/http/request.py @@ -113,11 +113,17 @@ class HttpRequest: return str(port) def get_full_path(self, force_append_slash=False): + return self._get_full_path(self.path, force_append_slash) + + def get_full_path_info(self, force_append_slash=False): + return self._get_full_path(self.path_info, force_append_slash) + + def _get_full_path(self, path, force_append_slash): # RFC 3986 requires query string arguments to be in the ASCII range. # Rather than crash if this doesn't happen, we encode defensively. return '%s%s%s' % ( - escape_uri_path(self.path), - '/' if force_append_slash and not self.path.endswith('/') else '', + escape_uri_path(path), + '/' if force_append_slash and not path.endswith('/') else '', ('?' + iri_to_uri(self.META.get('QUERY_STRING', ''))) if self.META.get('QUERY_STRING', '') else '' ) |
