MCPcopy Index your code
hub / github.com/GoEdgeLab/EdgeNode / httpParseHost

Function httpParseHost

internal/nodes/http_request_utils.go:231–241  ·  view source on GitHub ↗

分析URL中的Host部分

(urlString string)

Source from the content-addressed store, hash-verified

229
230// 分析URL中的Host部分
231func httpParseHost(urlString string) (host string, err error) {
232 if !urlSchemeRegexp.MatchString(urlString) {
233 urlString = "https://" + urlString
234 }
235
236 u, err := url.Parse(urlString)
237 if err != nil && u != nil {
238 return "", err
239 }
240 return u.Host, nil
241}

Callers 2

doCheckReferersMethod · 0.85
TestHTTPParseURLFunction · 0.85

Calls 2

MatchStringMethod · 0.80
ParseMethod · 0.80

Tested by 1

TestHTTPParseURLFunction · 0.68