summaryrefslogtreecommitdiff
path: root/replacer.go
diff options
context:
space:
mode:
authorFrancis Lavoie <lavofr@gmail.com>2023-03-27 16:51:13 -0400
committerGitHub <noreply@github.com>2023-03-27 20:51:13 +0000
commitf5a13a4ab4e1dd1066fa81fb044127ae18c4f001 (patch)
treea88584ff8b45099c8645b7ff833e3a7afa35cb4d /replacer.go
parent10b265d25279aa4aabdf3e390f580492cf0077f7 (diff)
replacer: Add HTTP time format (#5458)
Diffstat (limited to 'replacer.go')
-rw-r--r--replacer.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/replacer.go b/replacer.go
index 7f97f34..16d50ac 100644
--- a/replacer.go
+++ b/replacer.go
@@ -16,6 +16,7 @@ package caddy
import (
"fmt"
+ "net/http"
"os"
"path/filepath"
"runtime"
@@ -316,6 +317,8 @@ func globalDefaultReplacements(key string) (any, bool) {
return runtime.GOARCH, true
case "time.now":
return nowFunc(), true
+ case "time.now.http":
+ return nowFunc().Format(http.TimeFormat), true
case "time.now.common_log":
return nowFunc().Format("02/Jan/2006:15:04:05 -0700"), true
case "time.now.year":