mirror of
https://github.com/warmbly/warmbly.git
synced 2026-10-13 08:02:34 +00:00
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
15 lines
325 B
Go
15 lines
325 B
Go
package middleware
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/warmbly/warmbly/internal/config"
|
|
)
|
|
|
|
func DashboardOriginMiddleware() gin.HandlerFunc {
|
|
return func(c *gin.Context) {
|
|
ctx := config.WithDashboardOrigin(c.Request.Context(), c.GetHeader("Origin"))
|
|
c.Request = c.Request.WithContext(ctx)
|
|
c.Next()
|
|
}
|
|
}
|