Home / Function/ unescapeHeaderValue() — fiber Function Reference

unescapeHeaderValue() — fiber Function Reference

Architecture documentation for the unescapeHeaderValue() function in helpers.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  075b5250_dc10_53b4_3b25_4828630c476f["unescapeHeaderValue()"]
  bec0e401_e4cd_f765_6df3_a79059073e50["helpers.go"]
  075b5250_dc10_53b4_3b25_4828630c476f -->|defined in| bec0e401_e4cd_f765_6df3_a79059073e50
  a901a40e_1c24_0b91_6e95_807b7ecdec87["paramsMatch()"]
  a901a40e_1c24_0b91_6e95_807b7ecdec87 -->|calls| 075b5250_dc10_53b4_3b25_4828630c476f
  e3cc6318_07a4_ecac_7c64_699264bff354["getOffer()"]
  e3cc6318_07a4_ecac_7c64_699264bff354 -->|calls| 075b5250_dc10_53b4_3b25_4828630c476f
  style 075b5250_dc10_53b4_3b25_4828630c476f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

helpers.go lines 438–464

func unescapeHeaderValue(v []byte) ([]byte, error) {
	if bytes.IndexByte(v, '\\') == -1 {
		return v, nil
	}
	res := make([]byte, 0, len(v))
	escaping := false
	for i, c := range v {
		if escaping {
			res = append(res, c)
			escaping = false
			continue
		}
		if c == '\\' {
			// invalid escape at end of string
			if i == len(v)-1 {
				return nil, errInvalidEscapeSequence
			}
			escaping = true
			continue
		}
		res = append(res, c)
	}
	if escaping {
		return nil, errInvalidEscapeSequence
	}
	return res, nil
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does unescapeHeaderValue() do?
unescapeHeaderValue() is a function in the fiber codebase, defined in helpers.go.
Where is unescapeHeaderValue() defined?
unescapeHeaderValue() is defined in helpers.go at line 438.
What calls unescapeHeaderValue()?
unescapeHeaderValue() is called by 2 function(s): getOffer, paramsMatch.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free