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 = 4096
    Max number of bytes that http.DetectContentType needs to get the content type Fixme: Go back to 512 bytes once https://gitlab.com/gitlab-org/gitlab-workhorse/issues/208 has been merged
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`) InlineRegex = regexp.MustCompile(`^inline`) )
      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.