New submission from Hugo Almeida <sudo.xiangq...@gmail.com>:

Hi,

Sorry for my poor English, this is not a spam issue.

How to reproduce
================

File about `http/server.py`, line 1235 at main branch.

1st, change `protocol_version`, e.g. from "HTTP/1.0" to "HTTP/1.1":
---          protocol="HTTP/1.0", port=8000, ...
+++          protocol="HTTP/1.1", port=8000, ...

2ed, run with `python -m http.server` and test by: `curl http://127.0.0.1:8000 
2>/dev/null| head -n 1`

Result
======

The response head line will always been a fixed HTTP Version refer to 
`BaseHTTPRequestHandler.protocol_version` defined, thus "HTTP/1.0 200 OK" 
currently.

Expected
========

It should equal to `http.server.test(protocol="...")` which specified like 
above, for this issue, it is expected to be "HTTP/1.1 200 OK".

P.S.
====

I know it is just locate in a test code area (http.servers::test), but what I 
submit here is about a Python Variable Scope issue maybe.

----------
components: Library (Lib)
messages: 409894
nosy: openalmeida
priority: normal
severity: normal
status: open
title: http/server.py wont respect its protocol_version
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46285>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to