summaryrefslogtreecommitdiff
path: root/internal/router
diff options
from:
to:
context:
space:
mode:
authorGravatar Saya Andy <145215889+SayaAndy@users.noreply.github.com> 2025-11-01 09:57:53 +0700
committerGravatar GitHub <noreply@github.com> 2025-11-01 09:57:53 +0700
commitce86bf8e7a32a98aeab696bf38b0cc2f4ada4905 (patch)
tree6a776567ce9fefd2f0fbc00835b3b497ece30c7b /internal/router
parentbda4faeeed4d9859cfe8afd7952a751683d74bd8 (diff)
parent730728cd7f45f3d58aa4b213b967322b1ba5ea76 (diff)
downloadweb-0.11.2.tar.gz
web-0.11.2.zip
v0.11.2 (#19)v0.11.2
- fix: change nocontent status to ok if there is content
Diffstat (limited to 'internal/router')
-rw-r--r--internal/router/router.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/router/router.go b/internal/router/router.go
index 700fbbf..ef3f063 100644
--- a/internal/router/router.go
+++ b/internal/router/router.go
@@ -484,6 +484,10 @@ func (r *Router) generalPageSegment(c *fiber.Ctx, part string) error {
return c.Status(fiber.ErrInternalServerError.Code).SendString("failed to generate div")
}
+ if statusCode == fiber.StatusNoContent && len(content) != 0 {
+ statusCode = fiber.StatusOK
+ }
+
if statusCode >= 200 && statusCode < 300 && route.ToCache() != Disabled {
go r.supplements.PageCache.SetWithTTL(cacheKey, content, int64(len(content)), route.CacheDuration())
}