Skip to content

Commit

Permalink
Merge pull request #440 from DenisZhadan/patch-4
Browse files Browse the repository at this point in the history
add ACRA version in field User-Agent
  • Loading branch information
william-ferguson-au committed Apr 27, 2016
2 parents f45f46d + dec000f commit 79e6b05
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/org/acra/util/HttpRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManagerFactory;

import ch.acra.acra.BuildConfig;

import static org.acra.ACRA.LOG_TAG;

public final class HttpRequest {
Expand Down Expand Up @@ -118,7 +120,7 @@ public void send(@NonNull Context context, @NonNull URL url, @NonNull Method met
urlConnection.setReadTimeout(socketTimeOut);

// Set Headers
urlConnection.setRequestProperty("User-Agent", "Android");
urlConnection.setRequestProperty("User-Agent", String.format("Android ACRA %1$s", BuildConfig.VERSION_NAME)); //sent ACRA version to server
urlConnection.setRequestProperty("Accept",
"text/html,application/xml,application/json,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5");
urlConnection.setRequestProperty("Content-Type", type.getContentType());
Expand Down

0 comments on commit 79e6b05

Please sign in to comment.