Home / Function/ sanitizeFilename() — fiber Function Reference

sanitizeFilename() — fiber Function Reference

Architecture documentation for the sanitizeFilename() function in res.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  6177631c_88ff_9f22_a928_1791087cdd13["sanitizeFilename()"]
  4ab93de8_955a_4087_8264_32cf8000452f["res.go"]
  6177631c_88ff_9f22_a928_1791087cdd13 -->|defined in| 4ab93de8_955a_4087_8264_32cf8000452f
  style 6177631c_88ff_9f22_a928_1791087cdd13 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

res.go lines 182–196

func sanitizeFilename(filename string) string {
	for _, r := range filename {
		if unicode.IsControl(r) {
			b := make([]byte, 0, len(filename))
			for _, rr := range filename {
				if !unicode.IsControl(rr) {
					b = utf8.AppendRune(b, rr)
				}
			}
			return utils.TrimSpace(string(b))
		}
	}

	return utils.TrimSpace(filename)
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does sanitizeFilename() do?
sanitizeFilename() is a function in the fiber codebase, defined in res.go.
Where is sanitizeFilename() defined?
sanitizeFilename() is defined in res.go at line 182.

Analyze Your Own Codebase

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

Try Supermodel Free