]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.7] bpo-38216, bpo-36274: Allow subclasses to separately override validation and...
authorJason R. Coombs <jaraco@jaraco.com>
Sat, 28 Sep 2019 13:15:05 +0000 (09:15 -0400)
committerGitHub <noreply@github.com>
Sat, 28 Sep 2019 13:15:05 +0000 (09:15 -0400)
commit80dd66ac278ecbabbf843526e3a56f5031da9562
tree28108d741e10816f72d3fbbb22632e6362294748
parent6112b91bb827b07ab83e3e720aa055772a2c8b9d
[3.7] bpo-38216, bpo-36274: Allow subclasses to separately override validation and encoding behavior (GH-16448) (GH-16461)

* bpo-38216: Allow bypassing input validation

* bpo-36274: Also allow the URL encoding to be overridden.

* bpo-38216, bpo-36274: Add tests demonstrating a hook for overriding validation, test demonstrating override encoding, and a test to capture expectation of the interface for the URL.

* Call with skip_host to avoid tripping on the host checking in the URL.

* Remove obsolete comment.

* Make _prepare_path_encoding its own attr.

This makes overriding just that simpler.

Also, don't use the := operator to make backporting easier.

* Add a news entry.

* _prepare_path_encoding -> _encode_prepared_path()

* Once again separate the path validation and request encoding, drastically simplifying the behavior. Drop the guarantee that all processing happens in _prepare_path..
(cherry picked from commit 7774d7831e8809795c64ce27f7df52674581d298)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Lib/http/client.py
Lib/test/test_httplib.py
Misc/NEWS.d/next/Library/2019-09-27-15-24-45.bpo-38216.-7yvZR.rst [new file with mode: 0644]