| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead. |
Sorry, something went wrong.
There was a problem hiding this comment.
This change need tests.
I am not sure how much useful is this feature. It only allows to override the MIME type of unrecognized types. And would not it be simpler to configure your browser?
Sorry, something went wrong.
…QMpbI.rst Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
There was a problem hiding this comment.
The feature looks useful to me; I've wanted it once or twice before. However, adding it would be a lot work. Not sure if it's worth your time.
The change needs documentation (in Doc/library/http.server.rst, both for the attribute and CLI option).
Sorry, something went wrong.
|
@jcomeauictx are you going to continue working on this PR? |
Sorry, something went wrong.
I've forgotten what else needs to be done. And in any case, nobody else seems interested in it. |
Sorry, something went wrong.
|
|
||
| python -m http.server --default-content-type text/html | ||
|
|
||
| .. versionchanged:: 3.13 |
There was a problem hiding this comment.
| .. versionchanged:: 3.13 | |
| .. versionchanged:: next |
Sorry, something went wrong.
I'm interested :) |
Sorry, something went wrong.
|
OK, I'll look into it tomorrow. No idea where to add them, though, or what precisely needs to be tested. |
Sorry, something went wrong.
|
"move the description of this flag to the right place", what does that
mean? Could you please do it? I just corrected the hyphenation.
…On Sun, Mar 16, 2025 at 6:10 AM donBarbos ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In Doc/library/http.server.rst
<#113475 (comment)>:
> +By default, the server uses the MIME type ``'application/octet-stream'`` for
+the ``Content-Type`` header when the content type cannot be guessed from the
+URL's extension (if any). The option ``--default-content-type`` overrides
+this default with one of the user's choosing::
+
+ python -m http.server --default-content-type text/html
+
+.. versionchanged:: next
+ Added the ``--default-content-type`` option.
@jcomeauictx <https://github.com/jcomeauictx> we added usage of ..
option:: directory for CLI flags, we also need to move the description of
this flag to the right place, could you move it? (I also forgot the second
- before default-content-type, please add it :)
—
Reply to this email directly, view it on GitHub
<#113475 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABRUXUAWLKM3YQ2WNDDTZL2UVZ5XAVCNFSM6AAAAABYSPI2O6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDMOBYGY3DSNJZGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
John Comeau KE5TFZ WSEE965 ***@***.***> ***@***.***>
http://jc.unternet.net/
"A place for everything, and everything all over the place"
|
Sorry, something went wrong.
|
Sorry I can't. I mean move on to the rest options |
Sorry, something went wrong.
|
OK, please check that I did it right.
…On Sun, Mar 16, 2025 at 7:59 AM donBarbos ***@***.***> wrote:
Sorry I can't. I mean move on to the rest options
—
Reply to this email directly, view it on GitHub
<#113475 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABRUXV7CQROXHJA4WOQ2N32UWGTPAVCNFSM6AAAAABYSPI2O6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRXGQ4DKNRZHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
[image: donBarbos]*donBarbos* left a comment (python/cpython#113475)
<#113475 (comment)>
Sorry I can't. I mean move on to the rest options
—
Reply to this email directly, view it on GitHub
<#113475 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABRUXV7CQROXHJA4WOQ2N32UWGTPAVCNFSM6AAAAABYSPI2O6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRXGQ4DKNRZHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
John Comeau KE5TFZ WSEE965 ***@***.***> ***@***.***>
http://jc.unternet.net/
"A place for everything, and everything all over the place"
|
Sorry, something went wrong.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
|
I've resolved the merge conflict and pushed some minor docs things. default_content_type is defined on BaseHTTPRequestHandler, but only used in its subclass SimpleHTTPRequestHandler, in guess_type(). Should default_content_type be moved to SimpleHTTPRequestHandler? Also, test() defaults HandlerClass=BaseHTTPRequestHandler, but the CLI calls it with HandlerClass=SimpleHTTPRequestHandler. test() then sets HandlerClass.default_content_type. This doesn't matter to BaseHTTPRequestHandler if we move it, although we could also change test() to only use SimpleHTTPRequestHandler? |
Sorry, something went wrong.
|
I think I had a reason to put it in BaseRequestHandler, but it's been a long time and I've moved on to other things. Do what seems best. |
Sorry, something went wrong.
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Documentation build overview8 files changed · ± 8 modified ± Modified |
Sorry, something went wrong.
|
Thanks! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.