mirror of
https://github.com/soheilhy/cmux.git
synced 2024-11-09 19:21:52 +08:00
Implement the matcher HTTP1 fields
This commit adds the implementation for HTTP 1 header fields.
This commit is contained in:
parent
98f6f6f272
commit
cc3a35aef1
@ -121,7 +121,12 @@ func hasHTTP2Preface(r io.Reader) (ok bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func matchHTTP1Field(r io.Reader, name, value string) (matched bool) {
|
func matchHTTP1Field(r io.Reader, name, value string) (matched bool) {
|
||||||
return
|
req, err := http.ReadRequest(bufio.NewReader(r))
|
||||||
|
if err != nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return req.Header.Get(name) == value
|
||||||
}
|
}
|
||||||
|
|
||||||
func matchHTTP2Field(r io.Reader, name, value string) (matched bool) {
|
func matchHTTP2Field(r io.Reader, name, value string) (matched bool) {
|
||||||
|
Loading…
Reference in New Issue
Block a user