Browse Source

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

master
kolaente 2 months ago
parent
commit
8767618f18
Signed by: konrad GPG Key ID: F40E70337AB24C9B
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      handler/read_one.go

+ 4
- 2
handler/read_one.go 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 {

Loading…
Cancel
Save