mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-13 20:09:36 +03:00
Add header and method support to http2 transport (#755)
Co-authored-by: Shelikhoo <xiaokangwang@outlook.com>
This commit is contained in:
@ -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()
|
||||
|
Reference in New Issue
Block a user