Documentation ¶
Index ¶
Constants ¶
View Source
const ( ContentDispositionHeader = "Content-Disposition" ContentTypeHeader = "Content-Type" // Workhorse related headers GitlabWorkhorseSendDataHeader = "Gitlab-Workhorse-Send-Data" XSendFileHeader = "X-Sendfile" XSendFileTypeHeader = "X-Sendfile-Type" // Signal header that indicates Workhorse should detect and set the content headers GitlabWorkhorseDetectContentTypeHeader = "Gitlab-Workhorse-Detect-Content-Type" )
HTTP Headers
View Source
const MaxDetectSize = 512
Max number of bytes that http.DetectContentType needs to get the content type
Variables ¶
View Source
var ( ImageTypeRegex = regexp.MustCompile(`^image/*`) SvgMimeTypeRegex = regexp.MustCompile(`^image/svg\+xml$`) TextTypeRegex = regexp.MustCompile(`^text/*`) VideoTypeRegex = regexp.MustCompile(`^video/*`) AttachmentRegex = regexp.MustCompile(`^attachment`) )
View Source
var ResponseHeaders = []string{ XSendFileHeader, GitlabWorkhorseSendDataHeader, GitlabWorkhorseDetectContentTypeHeader, }
Functions ¶
func AnyResponseHeaderPresent ¶
func AnyResponseHeaderPresent(rw http.ResponseWriter) bool
AnyResponseHeaderPresent checks in the ResponseWriter if there is any Response Header
func IsDetectContentTypeHeaderPresent ¶
func IsDetectContentTypeHeaderPresent(rw http.ResponseWriter) bool
func RemoveResponseHeaders ¶
func RemoveResponseHeaders(rw http.ResponseWriter)
RemoveResponseHeaders removes any ResponseHeader from the ResponseWriter
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.