Move resp headers up
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2025-06-22 13:58:17 -04:00
parent 2b7277d955
commit 762eaef177

View File

@@ -47,17 +47,17 @@ func ValidateRequest(service, permission string, conn *grpc.ClientConn) gin.Hand
return
}
// Set the remaining rate limits in the response headers
ctx.Header(HeaderRateLimitBurst, strconv.FormatUint(resp.RemainingBurst, 10))
ctx.Header(HeaderRateLimitDaily, strconv.FormatUint(resp.RemainingDaily, 10))
ctx.Header(HeaderRateLimitMonthly, strconv.FormatUint(resp.RemainingMonthly, 10))
if !resp.Valid {
ctx.JSON(int(resp.StatusCode), gin.H{"error": resp.ErrorMessage})
ctx.Abort()
return
}
// Set the remaining rate limits in the response headers
ctx.Header(HeaderRateLimitBurst, strconv.FormatUint(resp.RemainingBurst, 10))
ctx.Header(HeaderRateLimitDaily, strconv.FormatUint(resp.RemainingDaily, 10))
ctx.Header(HeaderRateLimitMonthly, strconv.FormatUint(resp.RemainingMonthly, 10))
ctx.Next()
}
}