quoteString escapes special characters using percent-encoding. Non-ASCII bytes are encoded as well so the result is always ASCII.
(raw string)
| 168 | // quoteString escapes special characters using percent-encoding. |
| 169 | // Non-ASCII bytes are encoded as well so the result is always ASCII. |
| 170 | func (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 |