<feed xmlns='http://www.w3.org/2005/Atom'>
<title>cpython.git/Lib/test/test_httpservers.py, branch v3.12.0b2</title>
<subtitle>https://github.com/python/cpython.git</subtitle>
<link rel='alternate' type='text/html' href='http://service.techsat.com/oss-git/cpython.git/'/>
<entry>
<title>gh-103204: `http.server` - Enforce that HTTP version numbers must consist only of digits (#103205)</title>
<updated>2023-05-12T20:25:58Z</updated>
<author>
<name>Ben Kallus</name>
<email>49924171+kenballus@users.noreply.github.com</email>
</author>
<published>2023-05-12T20:25:58Z</published>
<link rel='alternate' type='text/html' href='http://service.techsat.com/oss-git/cpython.git/commit/?id=cf720acfcbd8c9c25a706a4b6df136465a803992'/>
<id>cf720acfcbd8c9c25a706a4b6df136465a803992</id>
<content type='text'>
Reject HTTP requests with invalid http/x.y version numbers: x or y being non-digits or too-long.

---------

Co-authored-by: Oleg Iarygin &lt;oleg@arhadthedev.net&gt;
Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reject HTTP requests with invalid http/x.y version numbers: x or y being non-digits or too-long.

---------

Co-authored-by: Oleg Iarygin &lt;oleg@arhadthedev.net&gt;
Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>gh-104049: do not expose on-disk location from SimpleHTTPRequestHandler (#104067)</title>
<updated>2023-05-03T03:42:00Z</updated>
<author>
<name>Ethan Furman</name>
<email>ethan@stoneleaf.us</email>
</author>
<published>2023-05-03T03:42:00Z</published>
<link rel='alternate' type='text/html' href='http://service.techsat.com/oss-git/cpython.git/commit/?id=c7c3a60c88de61a79ded9fdaf6bc6a29da4efb9a'/>
<id>c7c3a60c88de61a79ded9fdaf6bc6a29da4efb9a</id>
<content type='text'>
Do not expose the local server's on-disk location from `SimpleHTTPRequestHandler` when generating a directory index. (unnecessary information disclosure)

---------

Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;
Co-authored-by: Jelle Zijlstra &lt;jelle.zijlstra@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Do not expose the local server's on-disk location from `SimpleHTTPRequestHandler` when generating a directory index. (unnecessary information disclosure)

---------

Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;
Co-authored-by: Jelle Zijlstra &lt;jelle.zijlstra@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>gh-100474: Fix handling of dirs named index.html in http.server (GH-100475)</title>
<updated>2022-12-24T18:28:59Z</updated>
<author>
<name>James Frost</name>
<email>git@frost.cx</email>
</author>
<published>2022-12-24T18:28:59Z</published>
<link rel='alternate' type='text/html' href='http://service.techsat.com/oss-git/cpython.git/commit/?id=46e6a28308def2c3a71c679a6fa4ed7d520802b9'/>
<id>46e6a28308def2c3a71c679a6fa4ed7d520802b9</id>
<content type='text'>
If you had a directory called index.html or index.htm within a directory, it would cause http.server to return a 404 Not Found error instead of the directory listing. This came about due to not checking that the index was a regular file.

I have also added a test case for this situation.

Automerge-Triggered-By: GH:merwok</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If you had a directory called index.html or index.htm within a directory, it would cause http.server to return a 404 Not Found error instead of the directory listing. This came about due to not checking that the index was a regular file.

I have also added a test case for this situation.

Automerge-Triggered-By: GH:merwok</pre>
</div>
</content>
</entry>
<entry>
<title>gh-100001: Also escape \s in http.server log messages. (#100038)</title>
<updated>2022-12-05T22:27:55Z</updated>
<author>
<name>Gregory P. Smith</name>
<email>greg@krypto.org</email>
</author>
<published>2022-12-05T22:27:55Z</published>
<link rel='alternate' type='text/html' href='http://service.techsat.com/oss-git/cpython.git/commit/?id=7e29398407dbd53b714702abb89aa2fd7baca48a'/>
<id>7e29398407dbd53b714702abb89aa2fd7baca48a</id>
<content type='text'>
Also \ escape \s in the http.server BaseHTTPRequestHandler.log_message so
that it is technically possible to parse the line and reconstruct what the
original data was.  Without this a \xHH is ambiguious as to if it is a hex
replacement we put in or the characters r"\x" came through in the original
request line.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Also \ escape \s in the http.server BaseHTTPRequestHandler.log_message so
that it is technically possible to parse the line and reconstruct what the
original data was.  Without this a \xHH is ambiguious as to if it is a hex
replacement we put in or the characters r"\x" came through in the original
request line.</pre>
</div>
</content>
</entry>
<entry>
<title>gh-100001: Omit control characters in http.server stderr logs. (#100002)</title>
<updated>2022-12-05T20:55:45Z</updated>
<author>
<name>Gregory P. Smith</name>
<email>greg@krypto.org</email>
</author>
<published>2022-12-05T20:55:45Z</published>
<link rel='alternate' type='text/html' href='http://service.techsat.com/oss-git/cpython.git/commit/?id=d8ab0a4dfa48f881b4ac9ab857d2e9de42f72828'/>
<id>d8ab0a4dfa48f881b4ac9ab857d2e9de42f72828</id>
<content type='text'>
Replace control characters in http.server.BaseHTTPRequestHandler.log_message with an escaped \xHH sequence to avoid causing problems for the terminal the output is printed to.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace control characters in http.server.BaseHTTPRequestHandler.log_message with an escaped \xHH sequence to avoid causing problems for the terminal the output is printed to.</pre>
</div>
</content>
</entry>
<entry>
<title>gh-87389: Fix an open redirection vulnerability in http.server. (#93879)</title>
<updated>2022-06-21T20:16:57Z</updated>
<author>
<name>Gregory P. Smith</name>
<email>greg@krypto.org</email>
</author>
<published>2022-06-21T20:16:57Z</published>
<link rel='alternate' type='text/html' href='http://service.techsat.com/oss-git/cpython.git/commit/?id=4abab6b603dd38bec1168e9a37c40a48ec89508e'/>
<id>4abab6b603dd38bec1168e9a37c40a48ec89508e</id>
<content type='text'>
Fix an open redirection vulnerability in the `http.server` module when
an URI path starts with `//` that could produce a 301 Location header
with a misleading target.  Vulnerability discovered, and logic fix
proposed, by Hamza Avvan (@hamzaavvan).

Test and comments authored by Gregory P. Smith [Google].</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix an open redirection vulnerability in the `http.server` module when
an URI path starts with `//` that could produce a 301 Location header
with a misleading target.  Vulnerability discovered, and logic fix
proposed, by Hamza Avvan (@hamzaavvan).

Test and comments authored by Gregory P. Smith [Google].</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-47061: deprecate cgi and cgitb (GH-32410)</title>
<updated>2022-04-09T00:15:35Z</updated>
<author>
<name>Brett Cannon</name>
<email>brett@python.org</email>
</author>
<published>2022-04-09T00:15:35Z</published>
<link rel='alternate' type='text/html' href='http://service.techsat.com/oss-git/cpython.git/commit/?id=cd29bd13ef1fe18970c5d43b66c545dd03117cb9'/>
<id>cd29bd13ef1fe18970c5d43b66c545dd03117cb9</id>
<content type='text'>
Part of PEP 594.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Part of PEP 594.</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-40280: Skip socket, fork, subprocess tests on Emscripten (GH-31986)</title>
<updated>2022-03-22T10:04:36Z</updated>
<author>
<name>Christian Heimes</name>
<email>christian@python.org</email>
</author>
<published>2022-03-22T10:04:36Z</published>
<link rel='alternate' type='text/html' href='http://service.techsat.com/oss-git/cpython.git/commit/?id=deeaac49e267285158264643799624623f4a7b29'/>
<id>deeaac49e267285158264643799624623f4a7b29</id>
<content type='text'>
- Add requires_fork and requires_subprocess to more tests
- Skip extension import tests if dlopen is not available
- Don't assume that _testcapi is a shared extension
- Skip a lot of socket tests that don't work on Emscripten
- Skip mmap tests, mmap emulation is incomplete
- venv does not work yet
- Cannot get libc from executable

The "entire" test suite is now passing on Emscripten with EMSDK from git head (91 suites are skipped).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Add requires_fork and requires_subprocess to more tests
- Skip extension import tests if dlopen is not available
- Don't assume that _testcapi is a shared extension
- Skip a lot of socket tests that don't work on Emscripten
- Skip mmap tests, mmap emulation is incomplete
- venv does not work yet
- Cannot get libc from executable

The "entire" test suite is now passing on Emscripten with EMSDK from git head (91 suites are skipped).</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-45229: Remove test_main in many tests (GH-28405)</title>
<updated>2021-09-19T12:27:33Z</updated>
<author>
<name>Serhiy Storchaka</name>
<email>storchaka@gmail.com</email>
</author>
<published>2021-09-19T12:27:33Z</published>
<link rel='alternate' type='text/html' href='http://service.techsat.com/oss-git/cpython.git/commit/?id=40348acc180580371d25f75f46b27048e35f2435'/>
<id>40348acc180580371d25f75f46b27048e35f2435</id>
<content type='text'>
Instead of explicitly enumerate test classes for run_unittest()
use the unittest ability to discover tests. This also makes these
tests discoverable and runnable with unittest.

load_tests() can be used for dynamic generating tests and adding
doctests. setUpModule(), tearDownModule() and addModuleCleanup()
can be used for running code before and after all module tests.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of explicitly enumerate test classes for run_unittest()
use the unittest ability to discover tests. This also makes these
tests discoverable and runnable with unittest.

load_tests() can be used for dynamic generating tests and adding
doctests. setUpModule(), tearDownModule() and addModuleCleanup()
can be used for running code before and after all module tests.</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-44647: Fix test_httpservers failing on Unicode characters in os.environ on Windows (GH-27161)</title>
<updated>2021-07-15T19:14:24Z</updated>
<author>
<name>Łukasz Langa</name>
<email>lukasz@langa.pl</email>
</author>
<published>2021-07-15T19:14:24Z</published>
<link rel='alternate' type='text/html' href='http://service.techsat.com/oss-git/cpython.git/commit/?id=82b218f36ce6ef910bda5af227a9fd5be613c94f'/>
<id>82b218f36ce6ef910bda5af227a9fd5be613c94f</id>
<content type='text'>
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.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.</pre>
</div>
</content>
</entry>
</feed>
