Minify html on-the-fly before sending it to users
This commit is contained in:
parent
b3039768af
commit
785130dc36
7 changed files with 66 additions and 6 deletions
|
|
@ -72,6 +72,6 @@ var (
|
|||
return json.Marshal(map[string]any{"status": text, "code": code})
|
||||
})
|
||||
HTMLInterceptor = StatusInterceptor("text/html", func(code int, text string) ([]byte, error) {
|
||||
return []byte(`<!DOCTYPE HTML><title>` + text + `</title>` + text), nil
|
||||
return MinifyHTML([]byte(`<!DOCTYPE HTML><title>` + text + `</title>` + text)), nil
|
||||
})
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue