From 701d1ab638b23c24877fc41824add66232446676 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Thu, 2 Feb 2017 09:32:00 -0500 Subject: Updating server dependancies (#5249) --- vendor/github.com/xenolf/lego/acme/error.go | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'vendor/github.com/xenolf/lego/acme/error.go') diff --git a/vendor/github.com/xenolf/lego/acme/error.go b/vendor/github.com/xenolf/lego/acme/error.go index 2aa690b33..6d7013cf1 100644 --- a/vendor/github.com/xenolf/lego/acme/error.go +++ b/vendor/github.com/xenolf/lego/acme/error.go @@ -8,9 +8,7 @@ import ( "strings" ) -const ( - tosAgreementError = "Must agree to subscriber agreement before any further actions" -) +const tosAgreementError = "Must agree to subscriber agreement before any further actions" // RemoteError is the base type for all errors specific to the ACME protocol. type RemoteError struct { @@ -54,20 +52,17 @@ func (c challengeError) Error() string { func handleHTTPError(resp *http.Response) error { var errorDetail RemoteError - contenType := resp.Header.Get("Content-Type") - // try to decode the content as JSON - if contenType == "application/json" || contenType == "application/problem+json" { - decoder := json.NewDecoder(resp.Body) - err := decoder.Decode(&errorDetail) + contentType := resp.Header.Get("Content-Type") + if contentType == "application/json" || contentType == "application/problem+json" { + err := json.NewDecoder(resp.Body).Decode(&errorDetail) if err != nil { return err } } else { - detailBytes, err := ioutil.ReadAll(limitReader(resp.Body, 1024*1024)) + detailBytes, err := ioutil.ReadAll(limitReader(resp.Body, maxBodySize)) if err != nil { return err } - errorDetail.Detail = string(detailBytes) } -- cgit v1.2.3-1-g7c22