feat(proxy): Optimizes homepage response processing

Convert the HTML content into byte slices and set the Content-Length header.
To improve response performance and accuracy.
This commit is contained in:
Gouryella
2025-12-10 15:26:24 +08:00
parent 600e6141d5
commit 8e6f9c553a

View File

@@ -604,8 +604,10 @@ func (h *Handler) serveHomePage(w http.ResponseWriter, r *http.Request) {
</body>
</html>`
data := []byte(html)
w.Header().Set("Content-Type", "text/html")
w.Write([]byte(html))
w.Header().Set("Content-Length", fmt.Sprintf("%d", len(data)))
w.Write(data)
}
func (h *Handler) serveHealth(w http.ResponseWriter, r *http.Request) {