mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-11-28 16:46:56 +08:00
11 lines
289 B
Go
11 lines
289 B
Go
package middleware
|
|||
|
|
|
||
|
|
import (
|
||
|
|
"github.com/1Panel-dev/1Panel/core/utils/mcpapi"
|
||
|
|
"github.com/gin-gonic/gin"
|
||
|
|
)
|
||
|
|
|
||
|
|
func MCPDomainPolicy(c *gin.Context) bool {
|
||
|
|
return c.Request.URL.Path == "/mcp" && c.GetBool("MCP_WEBSITE_PROXY") ||
|
||
|
|
mcpapi.IsRequest(c.Request) && c.GetBool("MCP_API_AUTH")
|
||
|
|
}
|