MCPcopy Create free account
hub / github.com/kataras/iris / MakeDisposition

Function MakeDisposition

context/context.go:5532–5534  ·  view source on GitHub ↗

MakeDisposition generates an HTTP Content-Disposition field-value. Similar solution followed by: Spring(Java), Symfony(PHP) and Ruby on Rails frameworks too. Fixes CVE-2020-5398. Reported by motoyasu-saburi.

(filename string)

Source from the content-addressed store, hash-verified

5530//
5531// Fixes CVE-2020-5398. Reported by motoyasu-saburi.
5532func MakeDisposition(filename string) string {
5533 return `attachment; filename*=UTF-8''` + url.QueryEscape(filename)
5534} /*
5535// Found at: https://stackoverflow.com/questions/53069040/checking-a-string-contains-only-ascii-characters
5536// A faster (better, more idiomatic) version, which avoids unnecessary rune conversions.
5537func isASCII(s string) bool {

Callers 2

FileServerFunction · 0.92
SendFileWithRateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…