forked from TrueCloudLab/certificates
acme/api: Write headers for invalid challenges
Include the "Link" and "Location" headers on invalid challenge resources. An invalid challenge is still a perfectly acceptable response.
This commit is contained in:
parent
8ae32f50f2
commit
609e1312da
1 changed files with 1 additions and 3 deletions
|
@ -224,9 +224,7 @@ func (h *Handler) GetChallenge(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Add("Retry-After", ch.RetryAfter)
|
w.Header().Add("Retry-After", ch.RetryAfter)
|
||||||
w.Header().Add("Cache-Control", "no-cache")
|
w.Header().Add("Cache-Control", "no-cache")
|
||||||
api.JSON(w, ch)
|
api.JSON(w, ch)
|
||||||
case acme.StatusInvalid:
|
case acme.StatusValid, acme.StatusInvalid:
|
||||||
api.JSON(w, ch)
|
|
||||||
case acme.StatusValid:
|
|
||||||
getLink := h.Auth.GetLink
|
getLink := h.Auth.GetLink
|
||||||
w.Header().Add("Link", link(getLink(acme.AuthzLink, acme.URLSafeProvisionerName(prov), true, ch.GetAuthzID()), "up"))
|
w.Header().Add("Link", link(getLink(acme.AuthzLink, acme.URLSafeProvisionerName(prov), true, ch.GetAuthzID()), "up"))
|
||||||
w.Header().Set("Location", getLink(acme.ChallengeLink, acme.URLSafeProvisionerName(prov), true, ch.GetID()))
|
w.Header().Set("Location", getLink(acme.ChallengeLink, acme.URLSafeProvisionerName(prov), true, ch.GetID()))
|
||||||
|
|
Loading…
Reference in a new issue