-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
net/http/pprof: Index func does not set Content-Type header to text/html #37311
Comments
/cc @hyangah |
Change https://golang.org/cl/220324 mentions this issue: |
This issue has two conditions: add security header
No problem adding headers after testing, Please consider not adding |
@eudore I am afraid I don't understand what you want. My CL simply made the handler consistent with other existing handllers (Symbol, Profile, Trace, Cmdline, and error cases). If that's not what you want, send a PR with a clear explanation on why that's not desirable. Thanks. |
only add header |
I think it's my server's default content-type problem, so I issue it off. |
Fixes #37311 Change-Id: I9e1f37e991e5c203fe72061692f47584fbadfc58 Reviewed-on: https://go-review.googlesource.com/c/go/+/220324 Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Does this issue reproduce with the latest release?
yes
What did you do?
if global set response header
X-Content-Type-Options=nosniff
,pprof.Index response is text not is html in chrome.read current golang.org net/http/pprof library sourcecode,pprof.Index func is not set header
content-type: text/html; charset=utf-8
,so chrome show is text.------------ update ---------
my http server not is net/http.Server, will not defualt set content-type, so response does not exist context, and appear this error.
The text was updated successfully, but these errors were encountered: