mirror of
https://github.com/Gouryella/drip.git
synced 2026-02-23 21:00:44 +00:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user