diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2013-08-31 13:33:57 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2013-08-31 13:33:57 +0200 |
commit | 864a6b476b803294a89facabdb4014efb9444642 (patch) | |
tree | a119e7e16bec6e5a80860fb1e5004d546432963c /src/de | |
parent | 74b9bfdcc3b4a9465cb35c7aeddf87f8df7128be (diff) | |
download | AntennaPod-864a6b476b803294a89facabdb4014efb9444642.zip |
Set user agent header when making http requests
Diffstat (limited to 'src/de')
-rw-r--r-- | src/de/danoeh/antennapod/AppConfig.java | 2 | ||||
-rw-r--r-- | src/de/danoeh/antennapod/gpoddernet/GpodnetService.java | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/de/danoeh/antennapod/AppConfig.java b/src/de/danoeh/antennapod/AppConfig.java index 6caea4127..e79eb64e8 100644 --- a/src/de/danoeh/antennapod/AppConfig.java +++ b/src/de/danoeh/antennapod/AppConfig.java @@ -3,4 +3,6 @@ package de.danoeh.antennapod; public final class AppConfig { /** Should be used for debug logging. */ public final static boolean DEBUG = true; + /** Should be used when setting User-Agent header for HTTP-requests. */ + public final static String USER_AGENT = "AntennaPod/0.9.8.0"; } diff --git a/src/de/danoeh/antennapod/gpoddernet/GpodnetService.java b/src/de/danoeh/antennapod/gpoddernet/GpodnetService.java index dd45d178f..01efd0a4f 100644 --- a/src/de/danoeh/antennapod/gpoddernet/GpodnetService.java +++ b/src/de/danoeh/antennapod/gpoddernet/GpodnetService.java @@ -1,5 +1,6 @@ package de.danoeh.antennapod.gpoddernet; +import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.gpoddernet.model.GpodnetDevice; import de.danoeh.antennapod.gpoddernet.model.GpodnetPodcast; import de.danoeh.antennapod.gpoddernet.model.GpodnetSubscriptionChange; @@ -17,6 +18,7 @@ import org.apache.http.client.methods.HttpPut; import org.apache.http.client.methods.HttpRequestBase; import org.apache.http.entity.StringEntity; import org.apache.http.impl.auth.BasicScheme; +import org.apache.http.params.CoreProtocolPNames; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; @@ -43,6 +45,7 @@ public class GpodnetService { public GpodnetService() { httpClient = new GpodnetClient(); + httpClient.getParams().setParameter(CoreProtocolPNames.USER_AGENT, AppConfig.USER_AGENT); } /** |