1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-28 16:06:40 +01:00

fix: adds html content type to index.html (#3845)

This commit is contained in:
Amir Raminfar
2025-04-24 15:14:37 -07:00
committed by GitHub
parent f817452fb5
commit baf9f74fd0
2 changed files with 3 additions and 3 deletions

View File

@@ -2,7 +2,7 @@
HTTP/1.1 200 OK
Connection: close
Content-Security-Policy: default-src 'self' 'wasm-unsafe-eval' blob: https://cdn.jsdelivr.net https://*.duckdb.org; style-src 'self' 'unsafe-inline' blob:; img-src 'self' data:;
Content-Type: text/plain; charset=utf-8
Content-Type: text/html; charset=utf-8
foo page
@@ -10,7 +10,7 @@ foo page
HTTP/1.1 200 OK
Connection: close
Content-Security-Policy: default-src 'self' 'wasm-unsafe-eval' blob: https://cdn.jsdelivr.net https://*.duckdb.org; style-src 'self' 'unsafe-inline' blob:; img-src 'self' data:;
Content-Type: text/plain; charset=utf-8
Content-Type: text/html; charset=utf-8
index page
@@ -87,7 +87,6 @@ Content-Type: text/html
/* snapshot: Test_handler_between_dates_with_everything_complex */
{"m":{"msg":"a complex log message"},"ts":1589396197772,"id":62280847,"l":"unknown","s":"stdout","c":"123456"}
/* snapshot: Test_handler_between_dates_with_fill */
{"m":"INFO Testing stdout logs...","ts":1589396137772,"id":466600245,"l":"info","s":"stdout","c":"123456"}
{"m":"INFO Testing stderr logs...","ts":1589396197772,"id":1101501603,"l":"info","s":"stderr","c":"123456"}

View File

@@ -103,6 +103,7 @@ func (h *handler) executeTemplate(w http.ResponseWriter, req *http.Request) {
log.Fatal().Err(err).Msg("Could not parse index.html")
}
w.Header().Set("Content-Type", "text/html; charset=utf-8")
err = tmpl.Execute(w, data)
if err != nil {
log.Fatal().Err(err).Msg("Could not execute index.html")