Skip to content

mime: TypeByExtension should not output charset=utf8 #27078

@frostyplanet

Description

@frostyplanet

What version of Go are you using (go version)?

go1.10 linux/amd64

What operating system and processor architecture are you using (go env)?

linux ubuntu 16.04; regardless LC_ALL env setting

complied code run on windows 2012 also has this issue;

What did you do?

package main

import "mime"
func main() {
    println(mime.TypeByExtension(".html"))
}

What did you expect to see?

expect "text/html",

What did you see instead?

"text/html; charset=utf-8"

the html content may not be utf8 after all.
using the result from mime.TypeByExtension() and return in Content-Type header of one http response will make browser believe the chraset is utf8

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions