"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "wfe2/wfe.go" between
boulder-release-2020-06-23.tar.gz and boulder-release-2020-06-29.tar.gz

About: Boulder is an ACME-based Certificate Authority (CA) used by Let’s Encrypt (written in Go).

wfe.go  (boulder-release-2020-06-23):wfe.go  (boulder-release-2020-06-29)
skipping to change at line 47 skipping to change at line 47
) )
// Paths are the ACME-spec identified URL path-segments for various methods. // Paths are the ACME-spec identified URL path-segments for various methods.
// NOTE: In metrics/measured_http we make the assumption that these are all // NOTE: In metrics/measured_http we make the assumption that these are all
// lowercase plus hyphens. If you violate that assumption you should update // lowercase plus hyphens. If you violate that assumption you should update
// measured_http. // measured_http.
const ( const (
directoryPath = "/directory" directoryPath = "/directory"
newAcctPath = "/acme/new-acct" newAcctPath = "/acme/new-acct"
acctPath = "/acme/acct/" acctPath = "/acme/acct/"
authzPath = "/acme/authz/"
// For user-facing URLs we use a "v3" suffix to avoid potential confusion g // For user-facing URLs we use a "v3" suffix to avoid potential confusion g
// regarding ACMEv2. // regarding ACMEv2.
authzv2Path = "/acme/authz-v3/" authzv2Path = "/acme/authz-v3/"
challengev2Path = "/acme/chall-v3/" challengev2Path = "/acme/chall-v3/"
challengePath = "/acme/challenge/"
certPath = "/acme/cert/" certPath = "/acme/cert/"
revokeCertPath = "/acme/revoke-cert" revokeCertPath = "/acme/revoke-cert"
issuerPath = "/acme/issuer-cert" issuerPath = "/acme/issuer-cert"
buildIDPath = "/build" buildIDPath = "/build"
rolloverPath = "/acme/key-change" rolloverPath = "/acme/key-change"
newNoncePath = "/acme/new-nonce" newNoncePath = "/acme/new-nonce"
newOrderPath = "/acme/new-order" newOrderPath = "/acme/new-order"
orderPath = "/acme/order/" orderPath = "/acme/order/"
finalizeOrderPath = "/acme/finalize/" finalizeOrderPath = "/acme/finalize/"
skipping to change at line 520 skipping to change at line 518
if request.Method == http.MethodPost { if request.Method == http.MethodPost {
acct, prob := wfe.validPOSTAsGETForAccount(request, ctx, logEvent ) acct, prob := wfe.validPOSTAsGETForAccount(request, ctx, logEvent )
if prob != nil { if prob != nil {
wfe.sendError(response, logEvent, prob, nil) wfe.sendError(response, logEvent, prob, nil)
return return
} }
logEvent.Requester = acct.ID logEvent.Requester = acct.ID
} }
statusCode := http.StatusNoContent statusCode := http.StatusNoContent
// The ACME specification says GET requets should receive http.StatusNoCo ntent // The ACME specification says GET requests should receive http.StatusNoC ontent
// and HEAD/POST-as-GET requests should receive http.StatusOK. // and HEAD/POST-as-GET requests should receive http.StatusOK.
if request.Method != "GET" { if request.Method != "GET" {
statusCode = http.StatusOK statusCode = http.StatusOK
} }
response.WriteHeader(statusCode) response.WriteHeader(statusCode)
// The ACME specification says the server MUST include a Cache-Control he
ader
// field with the "no-store" directive in responses for the newNonce reso
urce,
// in order to prevent caching of this resource.
response.Header().Set("Cache-Control", "no-store")
} }
// sendError wraps web.SendError // sendError wraps web.SendError
func (wfe *WebFrontEndImpl) sendError(response http.ResponseWriter, logEvent *we b.RequestEvent, prob *probs.ProblemDetails, ierr error) { func (wfe *WebFrontEndImpl) sendError(response http.ResponseWriter, logEvent *we b.RequestEvent, prob *probs.ProblemDetails, ierr error) {
wfe.stats.httpErrorCount.With(prometheus.Labels{"type": string(prob.Type) }).Inc() wfe.stats.httpErrorCount.With(prometheus.Labels{"type": string(prob.Type) }).Inc()
web.SendError(wfe.log, probs.V2ErrorNS, response, logEvent, prob, ierr) web.SendError(wfe.log, probs.V2ErrorNS, response, logEvent, prob, ierr)
} }
func link(url, relation string) string { func link(url, relation string) string {
return fmt.Sprintf("<%s>;rel=\"%s\"", url, relation) return fmt.Sprintf("<%s>;rel=\"%s\"", url, relation)
 End of changes. 4 change blocks. 
3 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)