Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

html/template: MIME types handling is not case-insensitive #19968

Closed
stjj89 opened this issue Apr 14, 2017 · 1 comment
Closed

html/template: MIME types handling is not case-insensitive #19968

stjj89 opened this issue Apr 14, 2017 · 1 comment
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@stjj89
Copy link
Contributor

stjj89 commented Apr 14, 2017

Section 5.1 of RFC 2045 states that "[the MIME] type, subtype, and parameter names are not case sensitive." However, MIME types in the type attribute of script elements are not handled in a case insensitive manner in html/template. The following template:

<script type="text/javascript">{{"Hello"}}!</script>
<script type="TEXT/JAVASCRIPT">{{"Hello"}}!</script>

produces the following output

<script type="text/javascript">"Hello"!</script>
<script type="TEXT/JAVASCRIPT">Hello!</script>

The problem is that the type value is read directly from the template here and is never converted to lowercase when checked here.

@gopherbot
Copy link
Contributor

CL https://golang.org/cl/40702 mentions this issue.

@bradfitz bradfitz added the NeedsFix The path to resolution is known, but the work has not been done. label Apr 15, 2017
@bradfitz bradfitz added this to the Go1.9 milestone Apr 15, 2017
@golang golang locked and limited conversation to collaborators Apr 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants