@marcel91200 / caddy Mirror · read-only / commits / f5a13a4a
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 13, 05:30 UTC

replacer: Add HTTP time format (#5458)

Francis Lavoie committed Mar 27, 2023 at 16:51 UTC f5a13a4ab4e1dd1066fa81fb044127ae18c4f001
1 file changed +3
replacer.go
+3
@@ -16,6 +16,7 @@ package caddy
16
17 import (
18 "fmt"
19 + "net/http"
20 "os"
21 "path/filepath"
22 "runtime"
@@ -316,6 +317,8 @@ func globalDefaultReplacements(key string) (any, bool) {
317 return runtime.GOARCH, true
318 case "time.now":
319 return nowFunc(), true
320 + case "time.now.http":
321 + return nowFunc().Format(http.TimeFormat), true
322 case "time.now.common_log":
323 return nowFunc().Format("02/Jan/2006:15:04:05 -0700"), true
324 case "time.now.year":