mirror of
https://github.com/kataras/iris.git
synced 2026-01-06 03:27:27 +00:00
Happy new year! Update to 6.0.0 | HTTP/2 full support. https://github.com/kataras/iris/issues/565
full commit from development branch. Examples, book, middleware, plugins are updated to the latest iris version. Read HISTORY.md for more. The 'old' v5 branch which relied on fasthttp exists for those who want to use it navigate there: https://github.com/kataras/iris/tree/5.0.0
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
package iris
|
||||
|
||||
import (
|
||||
"io"
|
||||
|
||||
"github.com/kataras/go-fs"
|
||||
"github.com/kataras/go-template"
|
||||
"io"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -105,14 +106,14 @@ func (t *templateEngines) render(isFile bool, ctx *Context, filenameOrSource str
|
||||
|
||||
var out io.Writer
|
||||
if gzipEnabled && ctx.clientAllowsGzip() {
|
||||
ctx.RequestCtx.Response.Header.Add(varyHeader, acceptEncodingHeader)
|
||||
ctx.ResponseWriter.Header().Add(varyHeader, acceptEncodingHeader)
|
||||
ctx.SetHeader(contentEncodingHeader, "gzip")
|
||||
|
||||
gzipWriter := fs.AcquireGzipWriter(ctx.Response.BodyWriter())
|
||||
gzipWriter := fs.AcquireGzipWriter(ctx.ResponseWriter)
|
||||
defer fs.ReleaseGzipWriter(gzipWriter)
|
||||
out = gzipWriter
|
||||
} else {
|
||||
out = ctx.Response.BodyWriter()
|
||||
out = ctx.ResponseWriter
|
||||
}
|
||||
|
||||
if isFile {
|
||||
|
||||
Reference in New Issue
Block a user