You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
http.server does not support HTTP range requests #86809
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2020-12-15.02:24:06.143>labels= ['type-feature', 'library', '3.9', '3.10']
title='http.server does not support HTTP range requests'updated_at=<Date2021-02-20.22:02:16.315>user='https://github.com/AraHaan'
I have issues with range requests on http.server module (ran from python -m http.server command)
When requesting files to download from an program written in C (which uses range requests to update an progress bar) it ignores this and simply forces download of the entire thing at once) which in turn on my program makes the progress bar never update to display the progress of the download to the user.
It is a part from HTTP/1.1, I think this would be something good to actually have to support partial requests (if they request an range in the header of their request), for directory listings (which can be used to download files from), it could be considered helpful it be able to request specific byte ranges inside of the files to download at a time to split up bandwidth to not overwhelm an file server.
The code is under Apache 2.0 licence. I don't know if it can be integrated in codebase under the PSF licence.
Another question needs to be answered previously: does the maintainers want to add such feature to SimpleHTTPServer (which goal is to be very basic)? They could prefer to add a header refusing the Range header:
Accept-Ranges: none
Redhat extract: If HTTP installation is used, confirm that the HTTP RANGE option is supported by the web server. Thehttpd package shipped by Red Hat supports it by default.
I will try to fork this project to made a new one too make it work with improuvement...
I created RangeHTTPServer many years ago but can't remember the last time I used it. I'd be very happy if this functionality made it into SimpleHTTPServer and I could archive the repo.
Reacted by Peter Shih, André Paiusco, Luis Davim and Josh Moore
Activity
AraHaan commentedon Dec 15, 2020
I have issues with range requests on http.server module (ran from python -m http.server command)
When requesting files to download from an program written in C (which uses range requests to update an progress bar) it ignores this and simply forces download of the entire thing at once) which in turn on my program makes the progress bar never update to display the progress of the download to the user.
https://tools.ietf.org/id/draft-ietf-httpbis-p5-range-09.html#range.units
It is a part from HTTP/1.1, I think this would be something good to actually have to support partial requests (if they request an range in the header of their request), for directory listings (which can be used to download files from), it could be considered helpful it be able to request specific byte ranges inside of the files to download at a time to split up bandwidth to not overwhelm an file server.
AraHaan commentedon Dec 15, 2020
It seems there are some packages that supports the range requests too:
https://github.com/danvk/RangeHTTPServer
Not sure if that supports python 3 or not. It could be used to make a patch for http.server though.
sblondon commentedon Dec 24, 2020
RangeHTTPServer seems to support python3: there is a try-except clause to manage the different import of SimpleHTTPServer:
https://github.com/danvk/RangeHTTPServer/blob/master/RangeHTTPServer/__main__.py#L13
The code is under Apache 2.0 licence. I don't know if it can be integrated in codebase under the PSF licence.
Another question needs to be answered previously: does the maintainers want to add such feature to SimpleHTTPServer (which goal is to be very basic)? They could prefer to add a header refusing the Range header:
Accept-Ranges: none
https://tools.ietf.org/id/draft-ietf-httpbis-p5-range-09.html#header.accept-ranges
DavidBord commentedon Feb 20, 2021
I would appreciate a code review - thank you
Le-Syl21 commentedon Mar 3, 2023
Hi,
I've just install RangeHTTPServer to try but it's don't work as expected. it don't care about port anymore
It don't use the new directory arguments from python3.
The Range HTTP is need for PXE KickStart install https://access.redhat.com/solutions/1231383
Redhat extract: If HTTP installation is used, confirm that the HTTP RANGE option is supported by the web server. Thehttpd package shipped by Red Hat supports it by default.
I will try to fork this project to made a new one too make it work with improuvement...
danvk commentedon Mar 3, 2023
I created
RangeHTTPServermany years ago but can't remember the last time I used it. I'd be very happy if this functionality made it intoSimpleHTTPServerand I could archive the repo.11 remaining items
Merge branch 'python:main' into pythongh-86809
Merge branch 'main' into pythongh-86809
ford-prefect commentedon Jul 7, 2025
Would it make sense to return
Accept-Ranges: nonein the mean time?soup: Disable range requests when talking to Python's http.server
soup: Disable range requests when talking to Python's http.server
DrusTheAxe commentedon Jul 20, 2025
Will this be addressed? Is there a target release or ETA?
picnixz commentedon Jul 20, 2025
I'm waiting for the PR to be updated and yes, it should be in 3.15. We have a few months for that.
Merge branch 'main' into pythongh-86809
sakgoyal commentedon Sep 24, 2025
Merge branch 'main' into pythongh-86809
sakgoyal commentedon Sep 25, 2025
this is a much better regex to use.
test cases available here:
https://gist.github.com/sakgoyal/813339e39bd7b33338975976790f84d0
soup: Disable range requests when talking to Python's http.server
vadimkantorov commentedon Aug 9, 2026
Also hit this when serving locally
pmtilesmap format which relies on range HTTP queries