PLT-6678 Change Cache-Control to private for files (#6660)
Этот коммит содержится в:
коммит произвёл
Corey Hulen
родитель
1897a7ea9e
Коммит
4d4f2cea86
@@ -280,7 +280,7 @@ func getPublicFileOld(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func writeFileResponse(filename string, contentType string, bytes []byte, w http.ResponseWriter, r *http.Request) *model.AppError {
|
func writeFileResponse(filename string, contentType string, bytes []byte, w http.ResponseWriter, r *http.Request) *model.AppError {
|
||||||
w.Header().Set("Cache-Control", "max-age=2592000, public")
|
w.Header().Set("Cache-Control", "max-age=2592000, private")
|
||||||
w.Header().Set("Content-Length", strconv.Itoa(len(bytes)))
|
w.Header().Set("Content-Length", strconv.Itoa(len(bytes)))
|
||||||
|
|
||||||
if contentType != "" {
|
if contentType != "" {
|
||||||
|
|||||||
@@ -299,7 +299,7 @@ func getPublicFile(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func writeFileResponse(filename string, contentType string, bytes []byte, toDownload bool, w http.ResponseWriter, r *http.Request) *model.AppError {
|
func writeFileResponse(filename string, contentType string, bytes []byte, toDownload bool, w http.ResponseWriter, r *http.Request) *model.AppError {
|
||||||
w.Header().Set("Cache-Control", "max-age=2592000, public")
|
w.Header().Set("Cache-Control", "max-age=2592000, private")
|
||||||
w.Header().Set("Content-Length", strconv.Itoa(len(bytes)))
|
w.Header().Set("Content-Length", strconv.Itoa(len(bytes)))
|
||||||
|
|
||||||
if contentType != "" {
|
if contentType != "" {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user