Permalink
Browse files

use getFirstHeader rather than getHeaders

  • Loading branch information...
1 parent 0464c9c commit f8ba2f4e822fd57c3ccb5f507399ebdbdf72d04a @notnoop committed Jun 27, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/main/java/com/notnoop/mpns/internal/Utilities.java
View
6 src/main/java/com/notnoop/mpns/internal/Utilities.java
@@ -116,10 +116,10 @@ public static String escapeXml(String value) {
}
}
- private static String headerValue(HttpResponse response, String header) {
- Header[] headers = response.getHeaders(header);
+ private static String headerValue(HttpResponse response, String name) {
+ Header header = response.getFirstHeader(name);
- return headers.length == 0 ? null : headers[0].getValue();
+ return header == null ? null: header.getValue();
}
private static MpnsResponse[] logicalResponses = MpnsResponse.values();

0 comments on commit f8ba2f4

Please sign in to comment.