MCPcopy
hub / github.com/gofiber/fiber / quoteString

Method quoteString

helpers.go:170–175  ·  view source on GitHub ↗

quoteString escapes special characters using percent-encoding. Non-ASCII bytes are encoded as well so the result is always ASCII.

(raw string)

Source from the content-addressed store, hash-verified

168// quoteString escapes special characters using percent-encoding.
169// Non-ASCII bytes are encoded as well so the result is always ASCII.
170func (app *App) quoteString(raw string) string {
171 bb := bytebufferpool.Get()
172 quoted := string(fasthttp.AppendQuotedArg(bb.B, app.toBytes(raw)))
173 bytebufferpool.Put(bb)
174 return quoted
175}
176
177// quoteRawString escapes only characters that need quoting according to
178// https://www.rfc-editor.org/rfc/rfc9110#section-5.6.4 so the result may

Callers 3

AttachmentMethod · 0.80
DownloadMethod · 0.80

Calls 2

GetMethod · 0.65
PutMethod · 0.65