MCPcopy Index your code
hub / github.com/imroc/req / removeEmptyPort

Function removeEmptyPort

http_request.go:20–25  ·  view source on GitHub ↗

removeEmptyPort strips the empty port in ":port" to "" as mandated by RFC 3986 Section 6.2.3.

(host string)

Source from the content-addressed store, hash-verified

18// removeEmptyPort strips the empty port in ":port" to ""
19// as mandated by RFC 3986 Section 6.2.3.
20func removeEmptyPort(host string) string {
21 if hasPort(host) {
22 return strings.TrimSuffix(host, ":")
23 }
24 return host
25}
26
27func isNotToken(r rune) bool {
28 return !httpguts.IsTokenRune(r)

Callers 1

parseRequestURLFunction · 0.85

Calls 1

hasPortFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…