forked from TrueCloudLab/lego
ec667a7ed1
This patch adds code to only parse the HTTP response body as JSON if the content-type header advertises the content as JSON. In my case, the directory server was unavailable: it returned a 503 HTTP response code with an HTML document, and the only thing lego reported was: 2016/04/04 19:12:56 Could not create client: get directory at 'https://acme-v01.api.letsencrypt.org/directory': invalid character '<' looking for beginning of value This was caused by trying to parse the document body (HTML) as JSON, without looking at the content-type header and returning the JSON parse error. |
||
---|---|---|
.. | ||
challenges.go | ||
client.go | ||
client_test.go | ||
crypto.go | ||
crypto_test.go | ||
dns_challenge.go | ||
dns_challenge_manual.go | ||
dns_challenge_test.go | ||
error.go | ||
http.go | ||
http_challenge.go | ||
http_challenge_server.go | ||
http_challenge_test.go | ||
http_test.go | ||
jws.go | ||
messages.go | ||
pop_challenge.go | ||
provider.go | ||
tls_sni_challenge.go | ||
tls_sni_challenge_server.go | ||
tls_sni_challenge_test.go | ||
utils.go | ||
utils_test.go |