1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-23 04:47:02 +00:00

Add two examples for folder structuring as requested at https://github.com/kataras/iris/issues/748

Former-commit-id: 27c97d005d9cbd2309587b11fc9e2bab85870502
This commit is contained in:
Gerasimos (Makis) Maropoulos
2017-10-01 04:31:13 +03:00
parent 7989a2fd72
commit cf1e580cde
19 changed files with 299 additions and 12 deletions

View File

@@ -117,7 +117,7 @@ func (w *GzipResponseWriter) Write(contents []byte) (int, error) {
func (w *GzipResponseWriter) Writef(format string, a ...interface{}) (n int, err error) {
n, err = fmt.Fprintf(w, format, a...)
if err == nil {
w.ResponseWriter.Header().Set(contentTextHeaderValue, "text/plain")
w.ResponseWriter.Header().Set(contentTypeHeaderKey, contentTextHeaderValue)
}
return
@@ -128,7 +128,7 @@ func (w *GzipResponseWriter) Writef(format string, a ...interface{}) (n int, err
func (w *GzipResponseWriter) WriteString(s string) (n int, err error) {
n, err = w.Write([]byte(s))
if err == nil {
w.ResponseWriter.Header().Set(contentTextHeaderValue, "text/plain")
w.ResponseWriter.Header().Set(contentTypeHeaderKey, contentTextHeaderValue)
}
return
}
@@ -164,7 +164,7 @@ func (w *GzipResponseWriter) WriteNow(contents []byte) (int, error) {
}
w.ResponseWriter.Header().Add(varyHeaderKey, "Accept-Encoding")
w.ResponseWriter.Header().Set(contentEncodingHeaderKey, "gzip")
w.ResponseWriter.Header().Add(contentEncodingHeaderKey, "gzip")
// if not `WriteNow` but "Content-Length" header
// is exists, then delete it before `.Write`