Browse Source

apply h2 http header on server side

Shelikhoo 4 years ago
parent
commit
452de7c964
1 changed files with 9 additions and 0 deletions
  1. 9 0
      transport/internet/http/hub.go

+ 9 - 0
transport/internet/http/hub.go

@@ -71,6 +71,15 @@ func (l *Listener) ServeHTTP(writer http.ResponseWriter, request *http.Request)
 	}
 
 	writer.Header().Set("Cache-Control", "no-store")
+
+
+	for _, httpHeader := range l.config.Header {
+		for _, httpHeaderValue := range httpHeader.Value {
+			writer.Header().Set(httpHeader.Name, httpHeaderValue)
+		}
+	}
+
+
 	writer.WriteHeader(200)
 	if f, ok := writer.(http.Flusher); ok {
 		f.Flush()