MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / ToIndexHtml

Function ToIndexHtml

core/utils/security/security.go:60–70  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

58}
59
60func ToIndexHtml(c *gin.Context) {
61 c.Writer.Header().Set("Content-Type", "text/html; charset=utf-8")
62 c.Writer.WriteHeader(http.StatusOK)
63 data, err := web.IndexHtml.ReadFile("index.html")
64 if err != nil {
65 c.String(http.StatusInternalServerError, "index.html not found")
66 return
67 }
68 _, _ = c.Writer.Write(data)
69 c.Writer.Flush()
70}
71
72func isEntrancePath(c *gin.Context) bool {
73 entrance := service.NewIAuthService().GetSecurityEntrance()

Callers 1

HandleNotRouteFunction · 0.85

Calls 5

WriteHeaderMethod · 0.80
SetMethod · 0.45
StringMethod · 0.45
WriteMethod · 0.45
FlushMethod · 0.45

Tested by

no test coverage detected