diff --git a/bytesconv.go b/bytesconv.go index f203b29..1ac46c3 100644 --- a/bytesconv.go +++ b/bytesconv.go @@ -321,6 +321,18 @@ func appendQuotedArg(dst, v []byte) []byte { return dst } +func appendQuotedPath(dst, v []byte) []byte { + for _, c := range v { + if c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9' || + c == '/' || c == '.' || c == ',' || c == '=' || c == ':' || c == '&' || c == '~' || c == '-' || c == '_' { + dst = append(dst, c) + } else { + dst = append(dst, '%', hexCharUpper(c>>4), hexCharUpper(c&15)) + } + } + return dst +} + // EqualBytesStr returns true if string(b) == s. // // This function has no performance benefits comparing to string(b) == s. diff --git a/uri.go b/uri.go index a94dd54..eb1c243 100644 --- a/uri.go +++ b/uri.go @@ -434,15 +434,3 @@ func (x *URI) parseQueryArgs() { x.queryArgs.ParseBytes(x.queryString) x.parsedQueryArgs = true } - -func appendQuotedPath(dst, v []byte) []byte { - for _, c := range v { - if c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9' || - c == '/' || c == '.' || c == ',' || c == '=' || c == ':' || c == '&' || c == '~' || c == '-' || c == '_' { - dst = append(dst, c) - } else { - dst = append(dst, '%', hexCharUpper(c>>4), hexCharUpper(c&15)) - } - } - return dst -}