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, 03:00 UTC
caddyhttp: Add a getter for Server.name (#5531)
jjiang-stripe committed
May 11, 2023 at 09:34 UTC
cfc85ae8caf032c3ef92675a024fc5d1264ab7ce
1 file changed
+3
modules/caddyhttp/server.go
+3
@@ -733,6 +733,9 @@ func (s *Server) protocol(proto string) bool {
733
// EXPERIMENTAL: Subject to change or removal.
734
func (s *Server) Listeners() []net.Listener { return s.listeners }
735
736
+// Name returns the server's name.
737
+func (s *Server) Name() string { return s.name }
738
+
739
// PrepareRequest fills the request r for use in a Caddy HTTP handler chain. w and s can
740
// be nil, but the handlers will lose response placeholders and access to the server.
741
func PrepareRequest(r *http.Request, repl *caddy.Replacer, w http.ResponseWriter, s *Server) *http.Request {