mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-29 12:16:16 +08:00
Play nice when ACME used manually.
Minor change to server/server.go such that /.well-known/acme-challenge can be passed through when TLS.Manual is true on the vhost the request came in through.
This commit is contained in:
parent
e2f6ab3472
commit
52d7379063
|
@ -296,11 +296,6 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
w.Header().Set("Server", "Caddy")
|
||||
|
||||
// Execute the optional request callback if it exists
|
||||
if s.ReqCallback != nil && s.ReqCallback(w, r) {
|
||||
return
|
||||
}
|
||||
|
||||
host, _, err := net.SplitHostPort(r.Host)
|
||||
if err != nil {
|
||||
host = r.Host // oh well
|
||||
|
@ -315,6 +310,11 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
}
|
||||
|
||||
// Execute the optional request callback if it exists and it's not disabled
|
||||
if s.ReqCallback != nil && !s.vhosts[host].config.TLS.Manual && s.ReqCallback(w, r) {
|
||||
return
|
||||
}
|
||||
|
||||
if vh, ok := s.vhosts[host]; ok {
|
||||
status, _ := vh.stack.ServeHTTP(w, r)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user