Skip to content
Myr

Added ability to check if missing trailing slash in path.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Previously this URL would not work: http://example.com?foo=bar But this URL would work: http://example.com/?foo=bar Even though a slash is required for a valid URL, it is a common use case for the slash to be left out, so it would be a good idea to account for this.

authored by Brendon Crawford · committed by Brendon Crawford · parent 319b1ed · Browse files · 1 file+3 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−0 removed

  • other:+3 added−0 removed

1 file+3 added−0 removed

modified:requests/models.py+3 added
315 unmodified lines
316 raise ValueError("Invalid URL %r: No schema supplied" % url)317318 netloc = netloc.encode('idna').decode('utf-8')319320 if not path:321 path = '/'322323 if is_py2:324 if isinstance(path, str):325 path = path.encode('utf-8')326
482 unmodified lines