summaryrefslogtreecommitdiff
path: root/http/response.go
diff options
context:
space:
mode:
Diffstat (limited to 'http/response.go')
-rw-r--r--http/response.go34
1 files changed, 0 insertions, 34 deletions
diff --git a/http/response.go b/http/response.go
deleted file mode 100644
index 6a094bf3..00000000
--- a/http/response.go
+++ /dev/null
@@ -1,34 +0,0 @@
-package http
-
-import (
- "net/http"
- "github.com/sirupsen/logrus"
-)
-
-type Response struct {
- Status int `json:"status"`
- Headers map[string][]string `json:"headers"`
-}
-
-func (r *Response) Write(w http.ResponseWriter) {
- push := make([]string, 0)
- for k, v := range r.Headers {
- for _, h := range v {
- if k == "http2-push" {
- push = append(push, h)
- } else {
- w.Header().Add(k, h)
- }
- }
- }
-
- if p, ok := w.(http.Pusher); ok {
- logrus.Info("PUSH SUPPORTED")
- for _, f := range push {
- logrus.Info("pushing HTTP2 file ", f)
- p.Push(f, nil)
- }
- }
-
- w.WriteHeader(r.Status)
-}