Internal

internal/quotedstring

import "github.com/gofiber/fiber/v3/internal/quotedstring"

Package quotedstring encodes values placed inside HTTP quoted strings.

Functions

func Escape(raw string) string

Source: internal/quotedstring/quotedstring.go:45

Escape encodes raw for placement inside an RFC 9110 quoted-string. Quotes and backslashes use quoted-pair escaping, LF and CR use their conventional backslash forms, and other C0 controls plus DEL are percent-encoded. HTAB is encoded even though RFC 9110 permits it as qdtext. Non-ASCII bytes pass through verbatim. The returned value excludes the surrounding quotes. Escape is a serializer, not input validation; callers apply their own rejection or sanitization policy before calling it.