Improve HTTP headers option
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package option
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/netip"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -235,3 +236,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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user