Skip to content

Commit

Permalink
Let's try this
Browse files Browse the repository at this point in the history
  • Loading branch information
WalshyDev authored Mar 5, 2018
1 parent 60eb5e0 commit 704407f
Showing 1 changed file with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,21 @@ public enum Sender {
}

public static Sender getSender(Request request) {
this.userAgent = request.userAgent();
for (Sender sender : values) {
if (sender.requestPredicate.test(request))
return sender;
Sender sender = null;
for (Sender s : values) {
if (s.requestPredicate.test(request)) {
sender = s;
break;
}
}
return Sender.UNKNOWN;
if (sender == null)
sender = Sender.UNKNOWN;
sender.setUserAgent(request.userAgent());
return sender;
}

private void setUserAgent(String userAgent) {
this.userAgent = userAgent;
}

public String getUserAgent() {
Expand Down

0 comments on commit 704407f

Please sign in to comment.