Improve HTTP headers option

This commit is contained in:
septs
2023-10-08 22:05:42 +08:00
committed by 世界
parent 695283b968
commit b6101b5b11
6 changed files with 31 additions and 32 deletions

View File

@@ -1,6 +1,7 @@
package option
import (
"net/http"
"net/netip"
"time"
@@ -234,3 +235,15 @@ func DNSQueryTypeToString(queryType uint16) string {
}
return F.ToString(queryType)
}
type HTTPHeader map[string]Listable[string]
func (h HTTPHeader) Build() http.Header {
header := make(http.Header)
for name, values := range h {
for _, value := range values {
header.Add(name, value)
}
}
return header
}