Skip to content

Content type on static files lacks charset=UTF-8 #2987

Open
@Tronic

Description

@Tronic

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

app.static should specify UTF-8 for MIME types text/*. Currently it returns simply text/html for HTML files.

Code snippet

from sanic import Sanic

app = Sanic("index")
app.static("/", ".", index="index.html")

Expected Behavior

content-type: text/html; charset=UTF-8

How do you run Sanic?

Sanic CLI

Operating System

Linux

Sanic Version

24.6.0

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions