Skip to content

Commit cdadf18

Browse files
committed
handlers/object: always add the Content-Type header to GET&HEAD responses
Close #231. Signed-off-by: Tatiana Nesterenko <tatiana@nspcc.io>
1 parent 330d0bc commit cdadf18

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

handlers/objects.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,9 +460,8 @@ func (a *RestAPI) getByAddress(ctx echo.Context, addr oid.Address, downloadParam
460460
} else {
461461
contentType = http.DetectContentType(nil)
462462
}
463-
464-
ctx.Response().Header().Set("Content-Type", contentType)
465463
}
464+
ctx.Response().Header().Set("Content-Type", contentType)
466465

467466
ctx.Response().Header().Set(accessControlAllowOriginHeader, "*")
468467
return ctx.Stream(http.StatusOK, contentType, payload)
@@ -541,9 +540,8 @@ func (a *RestAPI) headByAddress(ctx echo.Context, addr oid.Address, downloadPara
541540
} else {
542541
contentType = http.DetectContentType(nil)
543542
}
544-
545-
ctx.Response().Header().Set("Content-Type", contentType)
546543
}
544+
ctx.Response().Header().Set("Content-Type", contentType)
547545

548546
return nil
549547
}

0 commit comments

Comments
 (0)