mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
set a user agent as some feeds return a 403 error code
This commit is contained in:
@@ -85,8 +85,11 @@ public class HttpGetter {
|
||||
HttpClient client = newClient();
|
||||
try {
|
||||
HttpGet httpget = new HttpGet(url);
|
||||
httpget.addHeader("Pragma", "No-cache");
|
||||
httpget.addHeader("Cache-Control", "no-cache");
|
||||
httpget.addHeader(HttpHeaders.PRAGMA, "No-cache");
|
||||
httpget.addHeader(HttpHeaders.CACHE_CONTROL, "no-cache");
|
||||
httpget.addHeader(
|
||||
HttpHeaders.USER_AGENT,
|
||||
"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1468.0 Safari/537.36");
|
||||
|
||||
if (lastModified != null) {
|
||||
httpget.addHeader(HttpHeaders.IF_MODIFIED_SINCE, lastModified);
|
||||
|
||||
Reference in New Issue
Block a user