(w http.ResponseWriter, r *http.Request)
| 242 | } |
| 243 | |
| 244 | func (iss *ZeroSSLIssuer) distributedHTTPValidationAnswer(w http.ResponseWriter, r *http.Request) bool { |
| 245 | if iss == nil { |
| 246 | return false |
| 247 | } |
| 248 | logger := iss.Logger |
| 249 | if logger == nil { |
| 250 | logger = zap.NewNop() |
| 251 | } |
| 252 | host := hostOnly(r.Host) |
| 253 | valInfo, distributed, err := iss.getDistributedValidationInfo(r.Context(), host) |
| 254 | if err != nil { |
| 255 | logger.Warn("looking up info for HTTP validation", |
| 256 | zap.String("host", host), |
| 257 | zap.String("remote_addr", r.RemoteAddr), |
| 258 | zap.String("user_agent", r.Header.Get("User-Agent")), |
| 259 | zap.Error(err)) |
| 260 | return false |
| 261 | } |
| 262 | return answerHTTPValidation(logger, w, r, valInfo, distributed) |
| 263 | } |
| 264 | |
| 265 | func answerHTTPValidation(logger *zap.Logger, rw http.ResponseWriter, req *http.Request, valInfo acme.Challenge, distributed bool) bool { |
| 266 | // ensure URL matches |
no test coverage detected