소스 검색

Prevent sending empty Content-Type header

kiska-2021
JustAnotherArchivist 3 년 전
부모
커밋
11aec07c2e
1개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  1. +6
    -2
      server/handlers.go

+ 6
- 2
server/handlers.go 파일 보기

@@ -970,7 +970,9 @@ func (s *Server) headHandler(w http.ResponseWriter, r *http.Request) {

remainingDownloads, remainingDays := metadata.remainingLimitHeaderValues()

w.Header().Set("Content-Type", contentType)
if contentType != "" {
w.Header().Set("Content-Type", contentType)
}
if !useZstd {
w.Header().Set("Content-Length", strconv.FormatUint(contentLength, 10))
}
@@ -1039,7 +1041,9 @@ func (s *Server) getHandler(w http.ResponseWriter, r *http.Request) {

remainingDownloads, remainingDays := metadata.remainingLimitHeaderValues()

w.Header().Set("Content-Type", contentType)
if contentType != "" {
w.Header().Set("Content-Type", contentType)
}
if !useZstd {
w.Header().Set("Content-Length", strconv.FormatUint(contentLength, 10))
} else {


불러오는 중...
취소
저장