summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/templates
diff options
context:
space:
mode:
Diffstat (limited to 'modules/caddyhttp/templates')
-rw-r--r--modules/caddyhttp/templates/templates.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/caddyhttp/templates/templates.go b/modules/caddyhttp/templates/templates.go
index d67b35b..f5df9be 100644
--- a/modules/caddyhttp/templates/templates.go
+++ b/modules/caddyhttp/templates/templates.go
@@ -113,6 +113,19 @@ func init() {
// {{.RemoteIP}}
// ```
//
+// ##### `.Req`
+//
+// Accesses the current HTTP request, which has various fields, including:
+//
+// - `.Method` - the method
+// - `.URL` - the URL, which in turn has component fields (Scheme, Host, Path, etc.)
+// - `.Header` - the header fields
+// - `.Host` - the Host or :authority header of the request
+//
+// ```
+// {{.Req.Header.Get "User-Agent"}}
+// ```
+//
// ##### `.RespHeader.Add`
//
// Adds a header field to the HTTP response.