mirror of
https://github.com/go-acme/lego.git
synced 2024-11-28 17:41:10 +02:00
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_test.go | ||
client.go | ||
crypto_test.go | ||
crypto.go | ||
dns_challenge_manual.go | ||
dns_challenge_test.go | ||
dns_challenge.go | ||
error.go | ||
http_challenge_server.go | ||
http_challenge_test.go | ||
http_challenge.go | ||
http_test.go | ||
http.go | ||
jws.go | ||
messages.go | ||
pop_challenge.go | ||
provider.go | ||
tls_sni_challenge_server.go | ||
tls_sni_challenge_test.go | ||
tls_sni_challenge.go | ||
utils_test.go | ||
utils.go |