diff options
author | jjiang-stripe <[email protected]> | 2023-05-11 09:34:05 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2023-05-11 10:34:05 -0600 |
commit | cfc85ae8caf032c3ef92675a024fc5d1264ab7ce (patch) | |
tree | f6fd02d50e42c0d9996116d4b112d5a5d0b79676 | |
parent | faf0399e80391ba5229321e2ee7d05262e4cc531 (diff) | |
download | caddy-cfc85ae8caf032c3ef92675a024fc5d1264ab7ce.tar.gz caddy-cfc85ae8caf032c3ef92675a024fc5d1264ab7ce.zip |
caddyhttp: Add a getter for Server.name (#5531)
-rw-r--r-- | modules/caddyhttp/server.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/caddyhttp/server.go b/modules/caddyhttp/server.go index fb71b1b45..411ec72af 100644 --- a/modules/caddyhttp/server.go +++ b/modules/caddyhttp/server.go @@ -733,6 +733,9 @@ func (s *Server) protocol(proto string) bool { // EXPERIMENTAL: Subject to change or removal. func (s *Server) Listeners() []net.Listener { return s.listeners } +// Name returns the server's name. +func (s *Server) Name() string { return s.name } + // PrepareRequest fills the request r for use in a Caddy HTTP handler chain. w and s can // be nil, but the handlers will lose response placeholders and access to the server. func PrepareRequest(r *http.Request, repl *caddy.Replacer, w http.ResponseWriter, s *Server) *http.Request { |