1
0
mirror of https://github.com/volatiletech/authboss.git synced 2025-04-07 07:20:05 +02:00

Merge remote-tracking branch 'offline-gmbh/master' into dev

This commit is contained in:
Aaron L 2018-12-31 09:53:08 -08:00
commit ca3933ab81

View File

@ -202,6 +202,16 @@ func (c ClientStateResponseWriter) Header() http.Header {
return c.ResponseWriter.Header()
}
// Hijack implements the http.Hijacker interface by calling the
// underlying implementation if available.
func (c ClientStateResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
h, ok := c.ResponseWriter.(http.Hijacker)
if ok {
return h.Hijack()
}
return nil, nil, errors.New("authboss: underlying ResponseWriter does not support hijacking")
}
// Write ensures that the client state is written before any writes
// to the body occur (before header flush to http client)
func (c *ClientStateResponseWriter) Write(b []byte) (int, error) {