Compare commits

...

2 Commits

Author SHA1 Message Date
650916c22a version updates 2019-10-14 13:46:45 +08:00
2804183325 fix issue in content-type response for ghttp.Server 2019-10-14 13:46:16 +08:00
3 changed files with 5 additions and 5 deletions

View File

@ -137,6 +137,10 @@ func (r *Response) WriteStatus(status int, content ...interface{}) {
} else {
r.Write(http.StatusText(status))
}
if r.Header().Get("Content-Type") == "" {
r.Header().Set("Content-Type", "text/plain; charset=utf-8")
//r.Header().Set("X-Content-Type-Options", "nosniff")
}
}
// ServeFile serves the file to the response.

View File

@ -155,10 +155,6 @@ func (s *Server) handleRequest(w http.ResponseWriter, r *http.Request) {
})
}
}
if request.Response.Header().Get("Content-Type") == "" {
request.Response.Header().Set("Content-Type", "text/plain; charset=utf-8")
//r.Header().Set("X-Content-Type-Options", "nosniff")
}
// 设置Session Id到Cookie中
if request.Session.IsDirty() && request.Session.Id() != request.GetSessionId() {

View File

@ -1,4 +1,4 @@
package gf
const VERSION = "v1.9.8"
const VERSION = "v1.9.9"
const AUTHORS = "john<john@goframe.org>"