mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 10:41:03 +01:00
minor
This commit is contained in:
parent
b063fbf3c8
commit
4c6568b874
|
@ -2717,6 +2717,11 @@ func (ctx *Context) CompressWriter(enable bool) error {
|
|||
w.Disabled = true
|
||||
case *ResponseRecorder:
|
||||
if enable {
|
||||
// If it's a recorder which already wraps the compress, exit.
|
||||
if _, ok := w.ResponseWriter.(*CompressResponseWriter); ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Keep the Recorder as ctx.writer.
|
||||
// Wrap the existing net/http response writer
|
||||
// with the compressed writer and
|
||||
|
|
|
@ -114,7 +114,14 @@ func (ac *AccessLog) SetOutput(writers ...io.Writer) *AccessLog {
|
|||
}
|
||||
}
|
||||
|
||||
ac.Writer = io.MultiWriter(writers...)
|
||||
switch len(writers) {
|
||||
case 0:
|
||||
case 1:
|
||||
ac.Writer = writers[0]
|
||||
default:
|
||||
ac.Writer = io.MultiWriter(writers...)
|
||||
}
|
||||
|
||||
return ac
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user