| 233 | } |
| 234 | |
| 235 | func (ash Handler) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error { |
| 236 | if strings.HasPrefix(r.URL.Path, ash.PathPrefix) { |
| 237 | acmeCtx := acme.NewContext( |
| 238 | r.Context(), |
| 239 | ash.acmeDB, |
| 240 | ash.acmeClient, |
| 241 | ash.acmeLinker, |
| 242 | nil, |
| 243 | ) |
| 244 | acmeCtx = authority.NewContext(acmeCtx, ash.acmeAuth) |
| 245 | r = r.WithContext(acmeCtx) |
| 246 | |
| 247 | ash.acmeEndpoints.ServeHTTP(w, r) |
| 248 | return nil |
| 249 | } |
| 250 | return next.ServeHTTP(w, r) |
| 251 | } |
| 252 | |
| 253 | func (ash Handler) getDatabaseKey() string { |
| 254 | key := ash.CA |