Only set the max right header if the user has any right at all
This commit is contained in:
parent
7e12686f28
commit
8767618f18
|
@ -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…
Reference in New Issue