respond: Add Content-Type note to the heredoc HTML example

This commit is contained in:
Francis Lavoie 2023-08-06 16:49:15 -04:00
parent d931345756
commit 029b64bef8
No known key found for this signature in database
GPG key ID: 0F66EE1687682239

View file

@ -55,9 +55,10 @@ respond /secret/* "Access denied" 403 {
}
```
Write an HTML response, using [heredoc syntax](/docs/caddyfile/concepts#heredocs) to control whitespace:
Write an HTML response, using [heredoc syntax](/docs/caddyfile/concepts#heredocs) to control whitespace, and also setting the `Content-Type` header to match the response body:
```caddy-d
header Content-Type text/html
respond <<HTML
<html>
<head><title>Foo</title></head>