Add header and method support to http2 transport (#755)

Co-authored-by: Shelikhoo <xiaokangwang@outlook.com>
This commit is contained in:
yuhan6665 2021-10-12 11:58:12 -04:00 committed by GitHub
parent 4bb61701b5
commit e6711d1b48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 106 additions and 33 deletions

View file

@ -70,6 +70,13 @@ 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()