mirror of
https://github.com/httpjamesm/AnonymousOverflow.git
synced 2025-04-19 05:19:14 +00:00
* feat: use css media query to derive theme * fix: rename alt for toggle images * feat: remove no-cache middleware
20 lines
327 B
Go
20 lines
327 B
Go
package middleware
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func OptionsMiddleware() gin.HandlerFunc {
|
|
return func(c *gin.Context) {
|
|
c.Set("disable_images", false)
|
|
|
|
imagesCookie, err := c.Cookie("disable_images")
|
|
if err == nil {
|
|
if imagesCookie == "true" {
|
|
c.Set("disable_images", true)
|
|
}
|
|
}
|
|
|
|
c.Next()
|
|
}
|
|
}
|