GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — default http content-type · Issue #113471 · python/cpython

default http content-type #113471

New issue
Copy link
New issue
Copy link
Closed
Closed
default http content-type#113471
Copy link
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

Description

@jcomeauictx
jcomeauictx
opened on Dec 25, 2023
Issue body actions

Feature or enhancement

Proposal:

Allow changing the default mime-type from application/octet-stream, so testing using python -m http.server doesn't automatically download files lacking extensions. Useful for testing with mitmproxy against a fake site copied from the real one.

python3 -m http.server -b 127.0.0.1 -c 'text/html'

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No previous discussion. This feature should not affect any existing code using the main branch of cpython.

Linked PRs

  • gh-113471: Add custom default Content-Type to http.server #113475
  • gh-113471: adds custom default content-type to http.server #131000

Activity

  1. jcomeauictx
    added
    type-featureA feature request or enhancementA feature request or enhancement
    on Dec 25, 2023
  2. Eclips4
    added
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    on Dec 25, 2023
  3. jcomeauictx commented on Dec 25, 2023

    @jcomeauictx
    jcomeauictx
    on Dec 25, 2023
    ContributorAuthor
    More actions

    submitting pull request shortly.

  4. jcomeauictx
    added a commit that references this issue on Dec 25, 2023

    DRY fix for python#113471

    b945ced
  5. jcomeauictx commented on Dec 26, 2023

    @jcomeauictx
    jcomeauictx
    on Dec 26, 2023 via email
    ContributorAuthor
    More actions
    text/plain is fine if that's what you want. and application/octet-stream is *still* the default, I haven't changed that. all I changed is the ability to *set* the default for your particular instantiation of the server, from the command line. I only gave text/html as an example because that works for me in my particular application.
    …
    On Tue, Dec 26, 2023 at 9:06 AM David Lord ***@***.***> wrote: Why should the default be text/html? Seems like "we don't know what this is, treat as binary" (application/octet-stream) is a safe assumption, and the next safest would be text/plain to avoid any interpretation of the data. — Reply to this email directly, view it on GitHub <#113471 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AABRUXXNTCU3GYKC43I2XC3YLLYWJAVCNFSM6AAAAABBCQBWIWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRZGYZTMNJYGI> . You are receiving this because you authored the thread.Message ID: ***@***.***>
    -- John Comeau KE5TFZ ***@***.*** http://jc.unternet.net/ "A place for everything, and everything all over the place"
  6. hugovk
    added a commit that references this issue on Apr 30, 2026

    gh-113471: Add custom default Content-Type to http.server (#113475)

    cc5f8b5
  7. hugovk
    closed this as completedon Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.