summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/templates/tplcontext.go
diff options
context:
space:
mode:
authorMatt Holt <mholt@users.noreply.github.com>2019-08-21 11:28:03 -0600
committerGitHub <noreply@github.com>2019-08-21 11:28:03 -0600
commit0544f0266a11874efb305a46db762248e64bc62d (patch)
tree3e75e6f59047bb967c52915e1e75aee6ad67c0ea /modules/caddyhttp/templates/tplcontext.go
parent42f75a4ca94ef3fb5e15a74e5dc9ef8b4f1f0b39 (diff)
parentb2aa679c33f63ebec5bc1a21bca01f345dffebdd (diff)
Merge pull request #2699 from caddyserver/cfadapter
v2: Implement config adapters and WIP Caddyfile adapter
Diffstat (limited to 'modules/caddyhttp/templates/tplcontext.go')
-rw-r--r--modules/caddyhttp/templates/tplcontext.go13
1 files changed, 0 insertions, 13 deletions
diff --git a/modules/caddyhttp/templates/tplcontext.go b/modules/caddyhttp/templates/tplcontext.go
index ffcc636..a51e54b 100644
--- a/modules/caddyhttp/templates/tplcontext.go
+++ b/modules/caddyhttp/templates/tplcontext.go
@@ -136,19 +136,6 @@ func (c templateContext) Cookie(name string) string {
return ""
}
-// Hostname gets the (remote) hostname of the client making the request.
-// Performance warning: This involves a DNS lookup.
-func (c templateContext) Hostname() string {
- ip := c.RemoteIP()
-
- hostnameList, err := net.LookupAddr(ip)
- if err != nil || len(hostnameList) == 0 {
- return c.Req.RemoteAddr
- }
-
- return hostnameList[0]
-}
-
// RemoteIP gets the IP address of the client making the request.
func (c templateContext) RemoteIP() string {
ip, _, err := net.SplitHostPort(c.Req.RemoteAddr)