Skip to content
Permalink
Browse files

Never force download in ViewCode mode

  • Loading branch information...
tribut committed Feb 16, 2018
1 parent c0887fa commit 654751917560378e06788546768f174283e796b9
Showing with 0 additions and 6 deletions.
  1. +0 −3 server/views/resources.go
  2. +0 −3 server/views/unencrypted.go
@@ -163,9 +163,6 @@ func ViewCCode(c *gin.Context) {
var iv [aes.BlockSize]byte
stream := cipher.NewCFBDecrypter(block, iv[:])
reader := &cipher.StreamReader{S: stream, R: f}
if conf.C.AlwaysDownload {
c.Header("Content-Type", "application/octet-stream")
}
c.Header("Content-Disposition", "filename=\""+re.Name+"\"")
buf := new(bytes.Buffer)
buf.ReadFrom(reader)
@@ -174,9 +174,6 @@ func ViewCode(c *gin.Context) {
c.AbortWithStatus(http.StatusInternalServerError)
return
}
if conf.C.AlwaysDownload {
c.Header("Content-Type", "application/octet-stream")
}
c.Header("Content-Disposition", "filename=\""+re.Name+"\"")
buf := new(bytes.Buffer)
buf.ReadFrom(f)

0 comments on commit 6547519

Please sign in to comment.
You can’t perform that action at this time.