mirror of
https://github.com/fankes/beszel.git
synced 2025-10-19 09:49:28 +08:00
fix: web ui should only respond to get requests
This commit is contained in:
@@ -126,7 +126,7 @@ func (h *Hub) Run() {
|
|||||||
Scheme: "http",
|
Scheme: "http",
|
||||||
Host: "localhost:5173",
|
Host: "localhost:5173",
|
||||||
})
|
})
|
||||||
se.Router.Any("/{path...}", func(e *core.RequestEvent) error {
|
se.Router.GET("/{path...}", func(e *core.RequestEvent) error {
|
||||||
proxy.ServeHTTP(e.Response, e.Request)
|
proxy.ServeHTTP(e.Response, e.Request)
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
@@ -146,7 +146,7 @@ func (h *Hub) Run() {
|
|||||||
// get CSP configuration
|
// get CSP configuration
|
||||||
csp, cspExists := GetEnv("CSP")
|
csp, cspExists := GetEnv("CSP")
|
||||||
// add route
|
// add route
|
||||||
se.Router.Any("/{path...}", func(e *core.RequestEvent) error {
|
se.Router.GET("/{path...}", func(e *core.RequestEvent) error {
|
||||||
// serve static assets if path is in staticPaths
|
// serve static assets if path is in staticPaths
|
||||||
for i := range staticPaths {
|
for i := range staticPaths {
|
||||||
if strings.Contains(e.Request.URL.Path, staticPaths[i]) {
|
if strings.Contains(e.Request.URL.Path, staticPaths[i]) {
|
||||||
|
Reference in New Issue
Block a user