1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-10 05:25:58 +00:00
Former-commit-id: 0bc9c92c519edda9e04be8481e16fd2fdcfc74c0
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-06-25 13:04:36 +03:00
parent 3fa022738b
commit 836e641229
10 changed files with 151 additions and 3 deletions

View File

@@ -3624,7 +3624,7 @@ type JSON struct {
Indent string
Prefix string
ASCII bool // if true writes with unicode to ASCII content.
Secure bool // if true then it adds a "while(1);" when Go slice (to JSON Array) value.
Secure bool // if true then it prepends a "while(1);" when Go slice (to JSON Array) value.
}
// JSONP contains the options for the JSONP (Context's) Renderer.

View File

@@ -349,6 +349,10 @@ func (w *responseWriter) WriteTo(to ResponseWriter) {
// the body is not copied, this writer doesn't support recording
}
// ErrHijackNotSupported is returned by the Hijack method to
// indicate that Hijack feature is not available.
var ErrHijackNotSupported = errors.New("hijack is not supported by this ResponseWriter")
// Hijack lets the caller take over the connection.
// After a call to Hijack(), the HTTP server library
// will not do anything else with the connection.
@@ -366,7 +370,7 @@ func (w *responseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
return h.Hijack()
}
return nil, nil, errors.New("hijack is not supported by this ResponseWriter")
return nil, nil, ErrHijackNotSupported
}
// Flusher indicates if `Flush` is supported by the client.