Only set the max right header if the user has any right at all

This commit is contained in:
kolaente 2020-08-09 17:48:28 +02:00
parent 7e12686f28
commit 8767618f18
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 4 additions and 2 deletions

View File

@ -57,8 +57,10 @@ func (c *WebHandler) ReadOneWeb(ctx echo.Context) error {
}
// Set the headers
ctx.Response().Header().Set("x-max-right", strconv.FormatInt(int64(maxRight), 10))
ctx.Response().Header().Set("Access-Control-Expose-Headers", "x-max-right")
if canRead {
ctx.Response().Header().Set("x-max-right", strconv.FormatInt(int64(maxRight), 10))
ctx.Response().Header().Set("Access-Control-Expose-Headers", "x-max-right")
}
err = ctx.JSON(http.StatusOK, currentStruct)
if err != nil {