summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_httpservers.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-44647: Fix test_httpservers failing on Unicode characters in os.environ ↵Miss Islington (bot)2021-07-151-4/+13
| | | | | | | | on Windows (GH-27161) (#27169) GH-23638 introduced a new test for Accept: headers in CGI HTTP servers. This test serializes all of os.environ on the server side. For non-UTF8 locales this can fail for some Unicode characters found in environment variables. This change fixes the HTTP_ACCEPT test. (cherry picked from commit 82b218f36ce6ef910bda5af227a9fd5be613c94f) Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* [3.10] bpo-43945: [Enum] reduce scope of new format() behavior (GH-26752) Ethan Furman2021-06-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | * [Enum] reduce scope of new format behavior Instead of treating all Enums the same for format(), only user mixed-in enums will be affected. In other words, IntEnum and IntFlag will not be changing the format() behavior, due to the requirement that they be drop-in replacements of existing integer constants. If a user creates their own integer-based enum, then the new behavior will apply: class Grades(int, Enum): A = 5 B = 4 C = 3 D = 2 F = 0 Now: format(Grades.B) -> DeprecationWarning and '4' 3.12: -> no warning, and 'B'. (cherry picked from commit f60b07ab6c943fce084772c3c7731ab3bbd213ff) Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
* bpo-43972: Set content-length to 0 for http.server.SimpleHTTPRequestHandler ↵Miss Islington (bot)2021-05-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 301s (GH-25705) * Set content-length for simple http server 301s When http.server.SimpleHTTPRequestHandler sends a 301 (Moved Permanently) due to a missing file, it does not set a Content-Length of 0. Unfortunately, certain clients can be left waiting for the connection to be closed in this circumstance, even though no body will be sent. At time of writing, both curl and Firefox demonstrate this behavior. * Test Content-Length on simple http server redirect When serving a redirect, the SimpleHTTPRequestHandler will now send `Content-Length: 0`. Several tests for http.server already cover various behaviors and checks including redirection. This change only adds one check for the expected Content-Length on the simplest case for a redirect. * Add news entry for SimpleHTTPRequestHandler fix * Clarify the specific kind of 301 Co-authored-by: Senthil Kumaran <skumaran@gatech.edu> (cherry picked from commit fb427255614fc1f740e7785554c1da8ca39116c2) Co-authored-by: Stephen Rosen <sirosen@globus.org>
* Remove Enum warnings from test_httpservers (GH-25844)Shreyan Avigyan2021-05-031-2/+2
|
* bpo-43651: Fix EncodingWarning in tests. (GH-25655)Inada Naoki2021-04-291-2/+2
| | | | | * test_httplib * test_httpservers * test_logging
* GH-5054: CGIHTTPRequestHandler.run_cgi() HTTP_ACCEPT improperly parsed (#23638)Senthil Kumaran2020-12-051-2/+35
|
* bpo-41521: Replace whitelist/blacklist with allowlist/denylist (GH-21822)Victor Stinner2020-08-111-2/+2
| | | Automerge-Triggered-By: @tiran
* bpo-40275: Use new test.support helper submodules in tests (GH-21743)Hai Shi2020-08-061-2/+2
|
* bpo-40275: Use new test.support helper submodules in tests (GH-21315)Hai Shi2020-07-061-5/+6
|
* bpo-40275: Adding threading_helper submodule in test.support (GH-20263)Hai Shi2020-05-271-2/+3
|
* bpo-38962: Fix reference leak in test_httpservers (GH-17454)Pablo Galindo2019-12-041-5/+9
|
* bpo-38863: Improve is_cgi() in http.server (GH-17312)Siwon Kang2019-11-221-0/+24
| | | | | | | | | | | | | | | | | | | is_cgi() function of http.server library does not currently handle a cgi script if one of the cgi_directories is located at the sub-directory of given path. Since is_cgi() in CGIHTTPRequestHandler class separates given path into (dir, rest) based on the first seen '/', multi-level directories like /sub/dir/cgi-bin/hello.py is divided into head=/sub, rest=dir/cgi-bin/hello.py then check whether '/sub' exists in cgi_directories = [..., '/sub/dir/cgi-bin']. This patch makes the is_cgi() keep expanding dir part to the next '/' then checking if that expanded path exists in the cgi_directories. Signed-off-by: Siwon Kang <kkangshawn@gmail.com> https://bugs.python.org/issue38863
* bpo-35640: Allow passing PathLike arguments to SimpleHTTPRequestHandler ↵Géry Ogam2019-09-111-23/+74
| | | | (GH-11398)
* bpo-37369: Fix initialization of sys members when launched via an app ↵Steve Dower2019-06-291-3/+4
| | | | | | | container (GH-14428) sys._base_executable is now always defined on all platforms, and can be overridden through configuration. Also adds test.support.PythonSymlink to encapsulate platform-specific logic for symlinking sys.executable
* bpo-24209: In http.server script, rely on getaddrinfo to bind to preferred ↵Jason R. Coombs2019-02-071-13/+55
| | | | | | | address based on the bind parameter. (#11767) In http.server script, rely on getaddrinfo to bind to preferred address based on the bind parameter. As a result, now IPv6 is used as the default (including IPv4 on dual-stack systems). Enhanced tests.
* Adds IPv6 support when invoking http.server directly. (GH-10595)Lisa Roach2018-11-261-0/+20
|
* bpo-31380: Skip test_httpservers test_undecodable_file on macOS. (#4720)Ned Deily2017-12-051-1/+2
| | | The undecodable file name cannot be created on macOS APFS file systems.
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-1/+2
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* bpo-31234: test_httpservers joins the server thread (#3188)Victor Stinner2017-08-221-0/+1
|
* bpo-31066: Fix test_httpservers.test_last_modified() (#2933)Victor Stinner2017-07-281-4/+6
| | | Write the temporary file on disk and then get its modification time.
* bpo-28707: Add the directory parameter to ↵Stéphane Wirtel2017-05-241-1/+6
| | | | | | | | http.server.SimpleHTTPRequestHandler and http.server module (#1776) * bpo-28707: call the constructor of SimpleHTTPRequestHandler in the test with a mock object * bpo-28707: Add the directory parameter to http.server.SimpleHTTPRequestHandler and http.server module
* bpo-29654 : Support If-Modified-Since HTTP header (browser cache) (#298)Pierre Quentel2017-04-021-1/+58
| | | | Return 304 response if file was not modified.
* Issue #28548: Parse HTTP request version even if too many words receivedMartin Panter2016-11-191-0/+10
|
* Fixes tests broken by issue #27781.Steve Dower2016-09-081-0/+2
|
* Fix typo in test nameBerker Peksag2016-08-241-1/+1
| | | | Noticed by Xiang Zhang.
* Issue #25738: Merge HTTP server from 3.5Martin Panter2016-06-081-0/+44
|\
| * Issue #25738: Don’t send message body for 205 Reset ContentMartin Panter2016-06-081-0/+44
| | | | | | | | Patch by Susumu Koshiba.
* | Issue #27076: Merge spelling from 3.5Martin Panter2016-05-261-1/+1
|\ \ | |/
| * Issue #27076: Doc, comment and tests spelling fixesMartin Panter2016-05-261-1/+1
| | | | | | | | Most fixes to Doc/ and Lib/ directories by Ville Skyttä.
* | Issue #26657: Merge http.server fix from 3.5Martin Panter2016-04-181-0/+19
|\ \ | |/
| * Issue #26657: Fix Windows directory traversal vulnerability with http.serverMartin Panter2016-04-181-0/+19
| | | | | | | | | | Based on patch by Philipp Hagemeister. This fixes a regression caused by revision f4377699fd47.
* | Issue #26585: Eliminate _quote_html() and use html.escape(quote=False)Martin Panter2016-04-111-1/+29
| | | | | | | | Patch by Xiang Zhang.
* | Issue #26609: Merge HTTP tests from 3.5Martin Panter2016-04-091-12/+29
|\ \ | |/
| * Issue #26609: Fix HTTP server tests to request an absolute URL pathMartin Panter2016-04-091-12/+29
| |
* | Issue #26586: Simple enhancements to BaseHTTPRequestHandler by Xiang ZhangMartin Panter2016-04-031-1/+1
| |
* | Issue #26586: Merge excessive HTTP header handling from 3.5Martin Panter2016-04-031-0/+7
|\ \ | |/
| * Issue #26586: Handle excessive header fields in http.server, by Xiang ZhangMartin Panter2016-04-031-0/+7
| |
* | Issue #747320: Use email.utils.formatdate() to avoid code duplicationBerker Peksag2016-03-141-0/+14
|/ | | | | | in BaseHTTPRequestHandler Initial patch by karlcow.
* Issues #25232, #24657: Use new enum status to match rest of testsMartin Panter2015-10-031-2/+2
|
* Issues #25232, #24657: Merge two CGI server fixes from 3.4 into 3.5Martin Panter2015-10-031-0/+31
|\
| * Issue #24657: Prevent CGIRequestHandler from collapsing the URL queryMartin Panter2015-10-031-0/+7
| | | | | | | | | | Initial patch from Xiang Zhang. Also fix out-of-date _url_collapse_path() doc string.
| * Issue #25232: Fix CGIRequestHandler's splitting of URL queryMartin Panter2015-10-031-0/+24
| | | | | | | | Patch from Xiang Zhang.
* | Issue #23440: Improve http.server.SimpleHTTPRequestHandler testsBerker Peksag2015-07-221-7/+29
| | | | | | | | | | | | | | * Tests that index.html is served, rather than an automatic directory listing * Tests that there is no extra data sent after the response Patch by Martin Panter.
* | Issue #21793: BaseHTTPRequestHandler again logs response code as numeric,Serhiy Storchaka2015-03-071-48/+92
|/ | | | not as stringified enum. Patch by Demian Brecht.
* document the requestline and close_connection attributes, use real booleans, ↵Benjamin Peterson2015-02-181-0/+39
| | | | | | and add tests (closes #23410) Patch by Martin Panter.
* Issue #23418: Add missing entries to http.server.__all__.Berker Peksag2015-02-131-0/+14
| | | | Patch by Martin Panter.
* Issue #22165: Skip test_undecodable_filename on OS X prior to 10.5.Ned Deily2015-01-051-0/+1
| | | | 10.4 systems do not allow creation of files with such filenames.
* fix behavior of trailing slash redirection when a query string is involved ↵Benjamin Peterson2014-12-261-0/+6
| | | | (closes #23112)
* Issue #20155: Fix non-buildbot test failure on Windows. Patch by Claudiu Popa,Terry Jan Reedy2014-10-181-1/+1
| | | | revised by R. David Murray.
* Issue #22165: Fixed test_undecodable_filename on Mac OS.Serhiy Storchaka2014-08-171-0/+7
|