mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-23 00:38:33 +02:00
refactor(httpheaders): replace strutils.SplitComma with strings.SplitSeq
This commit is contained in:
@@ -3,8 +3,8 @@ package httpheaders
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/textproto"
|
"net/textproto"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/yusing/go-proxy/internal/utils/strutils"
|
|
||||||
"golang.org/x/net/http/httpguts"
|
"golang.org/x/net/http/httpguts"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ func UpgradeType(h http.Header) string {
|
|||||||
func RemoveHopByHopHeaders(h http.Header) {
|
func RemoveHopByHopHeaders(h http.Header) {
|
||||||
// RFC 7230, section 6.1: Remove headers listed in the "Connection" header.
|
// RFC 7230, section 6.1: Remove headers listed in the "Connection" header.
|
||||||
for _, f := range h["Connection"] {
|
for _, f := range h["Connection"] {
|
||||||
for _, sf := range strutils.SplitComma(f) {
|
for sf := range strings.SplitSeq(f, ",") {
|
||||||
if sf = textproto.TrimString(sf); sf != "" {
|
if sf = textproto.TrimString(sf); sf != "" {
|
||||||
h.Del(sf)
|
h.Del(sf)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user