Skip to content

Commit baf9f74

Browse files
authored
fix: adds html content type to index.html (#3845)
1 parent f817452 commit baf9f74

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

internal/web/__snapshots__/web.snapshot

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
HTTP/1.1 200 OK
33
Connection: close
44
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:;
5-
Content-Type: text/plain; charset=utf-8
5+
Content-Type: text/html; charset=utf-8
66

77
foo page
88

99
/* snapshot: Test_createRoutes_index */
1010
HTTP/1.1 200 OK
1111
Connection: close
1212
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:;
13-
Content-Type: text/plain; charset=utf-8
13+
Content-Type: text/html; charset=utf-8
1414

1515
index page
1616

@@ -87,7 +87,6 @@ Content-Type: text/html
8787
/* snapshot: Test_handler_between_dates_with_everything_complex */
8888
{"m":{"msg":"a complex log message"},"ts":1589396197772,"id":62280847,"l":"unknown","s":"stdout","c":"123456"}
8989

90-
9190
/* snapshot: Test_handler_between_dates_with_fill */
9291
{"m":"INFO Testing stdout logs...","ts":1589396137772,"id":466600245,"l":"info","s":"stdout","c":"123456"}
9392
{"m":"INFO Testing stderr logs...","ts":1589396197772,"id":1101501603,"l":"info","s":"stderr","c":"123456"}

internal/web/index.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ func (h *handler) executeTemplate(w http.ResponseWriter, req *http.Request) {
103103
log.Fatal().Err(err).Msg("Could not parse index.html")
104104
}
105105

106+
w.Header().Set("Content-Type", "text/html; charset=utf-8")
106107
err = tmpl.Execute(w, data)
107108
if err != nil {
108109
log.Fatal().Err(err).Msg("Could not execute index.html")

0 commit comments

Comments
 (0)