Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
package context
|
|
|
|
|
|
|
|
import (
|
2017-08-18 16:09:18 +02:00
|
|
|
"fmt"
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
"io"
|
|
|
|
"sync"
|
|
|
|
|
|
|
|
"github.com/klauspost/compress/gzip"
|
|
|
|
)
|
|
|
|
|
|
|
|
// compressionPool is a wrapper of sync.Pool, to initialize a new compression writer pool
|
|
|
|
type compressionPool struct {
|
|
|
|
sync.Pool
|
|
|
|
Level int
|
|
|
|
}
|
|
|
|
|
|
|
|
// +------------------------------------------------------------+
|
|
|
|
// |GZIP raw io.writer, our gzip response writer will use that. |
|
|
|
|
// +------------------------------------------------------------+
|
|
|
|
|
|
|
|
// default writer pool with Compressor's level setted to -1
|
|
|
|
var gzipPool = &compressionPool{Level: -1}
|
|
|
|
|
|
|
|
// acquireGzipWriter prepares a gzip writer and returns it.
|
|
|
|
//
|
|
|
|
// see releaseGzipWriter too.
|
|
|
|
func acquireGzipWriter(w io.Writer) *gzip.Writer {
|
|
|
|
v := gzipPool.Get()
|
|
|
|
if v == nil {
|
|
|
|
gzipWriter, err := gzip.NewWriterLevel(w, gzipPool.Level)
|
|
|
|
if err != nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return gzipWriter
|
|
|
|
}
|
|
|
|
gzipWriter := v.(*gzip.Writer)
|
|
|
|
gzipWriter.Reset(w)
|
|
|
|
return gzipWriter
|
|
|
|
}
|
|
|
|
|
|
|
|
// releaseGzipWriter called when flush/close and put the gzip writer back to the pool.
|
|
|
|
//
|
|
|
|
// see acquireGzipWriter too.
|
|
|
|
func releaseGzipWriter(gzipWriter *gzip.Writer) {
|
|
|
|
gzipWriter.Close()
|
|
|
|
gzipPool.Put(gzipWriter)
|
|
|
|
}
|
|
|
|
|
|
|
|
// writeGzip writes a compressed form of p to the underlying io.Writer. The
|
|
|
|
// compressed bytes are not necessarily flushed until the Writer is closed.
|
|
|
|
func writeGzip(w io.Writer, b []byte) (int, error) {
|
|
|
|
gzipWriter := acquireGzipWriter(w)
|
|
|
|
n, err := gzipWriter.Write(b)
|
2017-08-18 16:09:18 +02:00
|
|
|
if err != nil {
|
|
|
|
releaseGzipWriter(gzipWriter)
|
|
|
|
return -1, err
|
|
|
|
}
|
|
|
|
err = gzipWriter.Flush()
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
releaseGzipWriter(gzipWriter)
|
|
|
|
return n, err
|
|
|
|
}
|
|
|
|
|
|
|
|
var gzpool = sync.Pool{New: func() interface{} { return &GzipResponseWriter{} }}
|
|
|
|
|
|
|
|
// AcquireGzipResponseWriter returns a new *GzipResponseWriter from the pool.
|
|
|
|
// Releasing is done automatically when request and response is done.
|
|
|
|
func AcquireGzipResponseWriter() *GzipResponseWriter {
|
|
|
|
w := gzpool.Get().(*GzipResponseWriter)
|
|
|
|
return w
|
|
|
|
}
|
|
|
|
|
|
|
|
func releaseGzipResponseWriter(w *GzipResponseWriter) {
|
|
|
|
gzpool.Put(w)
|
|
|
|
}
|
|
|
|
|
|
|
|
// GzipResponseWriter is an upgraded response writer which writes compressed data to the underline ResponseWriter.
|
|
|
|
//
|
2017-07-10 17:32:42 +02:00
|
|
|
// It's a separate response writer because iris gives you the ability to "fallback" and "roll-back" the gzip encoding if something
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
// went wrong with the response, and write http errors in plain form instead.
|
|
|
|
type GzipResponseWriter struct {
|
|
|
|
ResponseWriter
|
2017-08-18 16:09:18 +02:00
|
|
|
chunks []byte
|
|
|
|
disabled bool
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
}
|
|
|
|
|
2017-12-17 23:16:10 +01:00
|
|
|
var _ ResponseWriter = (*GzipResponseWriter)(nil)
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
|
2017-06-10 02:56:42 +02:00
|
|
|
// BeginGzipResponse accepts a ResponseWriter
|
|
|
|
// and prepares the new gzip response writer.
|
|
|
|
// It's being called per-handler, when caller decide
|
|
|
|
// to change the response writer type.
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
func (w *GzipResponseWriter) BeginGzipResponse(underline ResponseWriter) {
|
|
|
|
w.ResponseWriter = underline
|
2017-08-18 16:09:18 +02:00
|
|
|
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
w.chunks = w.chunks[0:0]
|
|
|
|
w.disabled = false
|
|
|
|
}
|
|
|
|
|
2017-06-10 02:56:42 +02:00
|
|
|
// EndResponse called right before the contents of this
|
|
|
|
// response writer are flushed to the client.
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
func (w *GzipResponseWriter) EndResponse() {
|
|
|
|
releaseGzipResponseWriter(w)
|
|
|
|
w.ResponseWriter.EndResponse()
|
|
|
|
}
|
|
|
|
|
2017-08-12 07:49:00 +02:00
|
|
|
// Write prepares the data write to the gzip writer and finally to its
|
|
|
|
// underline response writer, returns the uncompressed len(contents).
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
func (w *GzipResponseWriter) Write(contents []byte) (int, error) {
|
|
|
|
// save the contents to serve them (only gzip data here)
|
|
|
|
w.chunks = append(w.chunks, contents...)
|
|
|
|
return len(w.chunks), nil
|
|
|
|
}
|
|
|
|
|
2017-08-18 16:09:18 +02:00
|
|
|
// Writef formats according to a format specifier and writes to the response.
|
|
|
|
//
|
|
|
|
// Returns the number of bytes written and any write error encountered.
|
|
|
|
func (w *GzipResponseWriter) Writef(format string, a ...interface{}) (n int, err error) {
|
2017-08-19 06:11:30 +02:00
|
|
|
n, err = fmt.Fprintf(w, format, a...)
|
|
|
|
if err == nil {
|
2017-10-09 14:26:46 +02:00
|
|
|
w.ResponseWriter.Header().Set(contentTypeHeaderKey, ContentTextHeaderValue)
|
2017-08-19 06:11:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return
|
2017-08-18 16:09:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// WriteString prepares the string data write to the gzip writer and finally to its
|
|
|
|
// underline response writer, returns the uncompressed len(contents).
|
2017-08-19 06:11:30 +02:00
|
|
|
func (w *GzipResponseWriter) WriteString(s string) (n int, err error) {
|
|
|
|
n, err = w.Write([]byte(s))
|
|
|
|
if err == nil {
|
2017-10-09 14:26:46 +02:00
|
|
|
w.ResponseWriter.Header().Set(contentTypeHeaderKey, ContentTextHeaderValue)
|
2017-08-19 06:11:30 +02:00
|
|
|
}
|
|
|
|
return
|
2017-08-18 16:09:18 +02:00
|
|
|
}
|
|
|
|
|
2017-08-12 07:49:00 +02:00
|
|
|
// WriteNow compresses and writes that data to the underline response writer,
|
|
|
|
// returns the compressed written len.
|
|
|
|
//
|
|
|
|
// Use `WriteNow` instead of `Write`
|
|
|
|
// when you need to know the compressed written size before
|
|
|
|
// the `FlushResponse`, note that you can't post any new headers
|
|
|
|
// after that, so that information is not closed to the handler anymore.
|
|
|
|
func (w *GzipResponseWriter) WriteNow(contents []byte) (int, error) {
|
|
|
|
if w.disabled {
|
2017-08-18 16:09:18 +02:00
|
|
|
// type noOp struct{}
|
|
|
|
//
|
|
|
|
// func (n noOp) Write([]byte) (int, error) {
|
|
|
|
// return 0, nil
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// var noop = noOp{}
|
|
|
|
// problem solved with w.gzipWriter.Reset(noop):
|
|
|
|
//
|
|
|
|
// the below Write called multiple times but not from here,
|
|
|
|
// the gzip writer does something to the writer, even if we don't call the
|
|
|
|
// w.gzipWriter.Write it does call the underline http.ResponseWriter
|
|
|
|
// multiple times, and therefore it changes the content-length
|
|
|
|
// the problem that results to the #723.
|
|
|
|
//
|
|
|
|
// Or a better idea, acquire and adapt the gzip writer on-time when is not disabled.
|
|
|
|
// So that is not needed any more:
|
|
|
|
// w.gzipWriter.Reset(noop)
|
2017-08-12 07:49:00 +02:00
|
|
|
return w.ResponseWriter.Write(contents)
|
|
|
|
}
|
|
|
|
|
|
|
|
w.ResponseWriter.Header().Add(varyHeaderKey, "Accept-Encoding")
|
2017-10-01 03:31:13 +02:00
|
|
|
w.ResponseWriter.Header().Add(contentEncodingHeaderKey, "gzip")
|
2017-08-18 16:09:18 +02:00
|
|
|
|
2017-08-12 07:49:00 +02:00
|
|
|
// if not `WriteNow` but "Content-Length" header
|
|
|
|
// is exists, then delete it before `.Write`
|
|
|
|
// Content-Length should not be there.
|
|
|
|
// no, for now at least: w.ResponseWriter.Header().Del(contentLengthHeaderKey)
|
2017-08-18 16:09:18 +02:00
|
|
|
return writeGzip(w.ResponseWriter, contents)
|
2017-08-12 07:49:00 +02:00
|
|
|
}
|
|
|
|
|
2017-06-10 02:56:42 +02:00
|
|
|
// FlushResponse validates the response headers in order to be compatible with the gzip written data
|
|
|
|
// and writes the data to the underline ResponseWriter.
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
func (w *GzipResponseWriter) FlushResponse() {
|
2017-08-12 07:49:00 +02:00
|
|
|
w.WriteNow(w.chunks)
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
w.ResponseWriter.FlushResponse()
|
|
|
|
}
|
|
|
|
|
|
|
|
// ResetBody resets the response body.
|
|
|
|
func (w *GzipResponseWriter) ResetBody() {
|
|
|
|
w.chunks = w.chunks[0:0]
|
|
|
|
}
|
|
|
|
|
2017-06-10 03:21:55 +02:00
|
|
|
// Disable turns off the gzip compression for the next .Write's data,
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
// if called then the contents are being written in plain form.
|
|
|
|
func (w *GzipResponseWriter) Disable() {
|
|
|
|
w.disabled = true
|
|
|
|
}
|