From c6f34011fb56876dee49551a45c11de8382a5e97 Mon Sep 17 00:00:00 2001 From: jjiang-stripe <55402658+jjiang-stripe@users.noreply.github.com> Date: Thu, 11 May 2023 09:34:05 -0700 Subject: [PATCH] caddyhttp: Add a getter for Server.name (#5531) --- modules/caddyhttp/server.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/caddyhttp/server.go b/modules/caddyhttp/server.go index 7a244d2c..43521976 100644 --- a/modules/caddyhttp/server.go +++ b/modules/caddyhttp/server.go @@ -669,6 +669,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 {