diff --git a/src/data_sources.cpp b/src/data_sources.cpp index cd6aa45..805cade 100644 --- a/src/data_sources.cpp +++ b/src/data_sources.cpp @@ -50,7 +50,8 @@ HTTPSDataSource::HTTPSDataSource(String url, uint32_t offset) { DEBUG("Connecting to %s...\n", url.c_str()); if (_http) delete _http; _http = new HTTPClient(); - const char* headers[] = {"location"}; + _http->setUserAgent("PodBox 0.1"); + const char* headers[] = {"Location"}; _http->collectHeaders(headers, 1); bool result = _http->begin(url); DEBUG("HTTP->begin result: %d\n", result); @@ -60,8 +61,6 @@ HTTPSDataSource::HTTPSDataSource(String url, uint32_t offset) { if (status == HTTP_CODE_FOUND || status==HTTP_CODE_MOVED_PERMANENTLY || status==HTTP_CODE_TEMPORARY_REDIRECT) { if (_http->hasHeader("Location")) { url = _http->header("Location"); - } else if (_http->hasHeader("location")) { - url = _http->header("location"); } else { ERROR("Got redirection HTTP code, but could not find Location header.\n"); for(int i=0; i<_http->headers(); i++) {