1
0
mirror of https://github.com/go-acme/lego.git synced 2025-02-08 11:47:56 +02:00
Alexander Neumann ec667a7ed1 Only try to parse JSON documents
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.
2016-04-04 23:15:49 +02:00
..
2016-02-21 04:18:45 +01:00
2016-04-04 23:15:49 +02:00
2016-02-14 14:33:54 -07:00
2016-03-27 12:38:49 -07:00
2016-03-11 04:52:59 +01:00
2016-03-11 04:52:59 +01:00