Re: [go-nuts] net/http: Redirect writes HTML for GET requests without setting Content-Type, how come?

2017-09-04 Thread Dmitri Shuralyov
Quick followup note here. The CL that resolves this issue has been merged, and should be a part of Go 1.10 release. On Saturday, July 22, 2017 at 11:46:40 PM UTC-4, Dmitri Shuralyov wrote: > > Thanks Matt, that corroborates with my understanding too. > > I've sent a CL

Re: [go-nuts] net/http: Redirect writes HTML for GET requests without setting Content-Type, how come?

2017-07-22 Thread Dmitri Shuralyov
Thanks Matt, that corroborates with my understanding too. I've sent a CL https://go-review.googlesource.com/c/50510 to fix it, it can be reviewed after the tree unfreezes. > (perhaps only if it's not already set?) It's good to think this through, but I don't think it's worth checking for

Re: [go-nuts] net/http: Redirect writes HTML for GET requests without setting Content-Type, how come?

2017-07-22 Thread Matt Harden
That sounds like a bug. The whole reason for including a message is for older user-agents that don't understand redirects (must be *really* old! So the Content-Type should be set as if responding normally to a GET request. I think Redirect should be setting Content-Type (perhaps only if it's not

[go-nuts] net/http: Redirect writes HTML for GET requests without setting Content-Type, how come?

2017-07-18 Thread Dmitri Shuralyov
I've written a little middleware to help catch instances where I write some content in an HTTP handler, but forget to set the Content-Type header. I prefer to always set it to avoid forcing the browser to guess. It feels good and produces more predictable results. I've noticed some of my