aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/net/http/server.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/net/http/server.go b/src/net/http/server.go
index e68ec2f01e..9ae0bbff14 100644
--- a/src/net/http/server.go
+++ b/src/net/http/server.go
@@ -3223,6 +3223,25 @@ type timeoutWriter struct {
code int
}
+var _ Pusher = (*timeoutWriter)(nil)
+var _ Flusher = (*timeoutWriter)(nil)
+
+// Push implements the Pusher interface.
+func (tw *timeoutWriter) Push(target string, opts *PushOptions) error {
+ if pusher, ok := tw.w.(Pusher); ok {
+ return pusher.Push(target, opts)
+ }
+ return ErrNotSupported
+}
+
+// Flush implements the Flusher interface.
+func (tw *timeoutWriter) Flush() {
+ f, ok := tw.w.(Flusher)
+ if ok {
+ f.Flush()
+ }
+}
+
func (tw *timeoutWriter) Header() Header { return tw.h }
func (tw *timeoutWriter) Write(p []byte) (int, error) {