Skip to content

Commit

Permalink
Fix cookies.
Browse files Browse the repository at this point in the history
  • Loading branch information
consiliens committed Jul 6, 2011
1 parent 94ed12d commit 424dab2
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/com/github/consiliens/harv/util/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,7 @@ public static void convertRecordsToHAR(final List<IRequestLogRecord> recordsList
if (headerValue != null && headerName.equalsIgnoreCase("Cookie")) {
List<HttpCookie> parsedCookies = HttpCookie.parse(headerValue);
for (HttpCookie aCookie : parsedCookies) {
// expires = max age
// does HttpCookie support the "httpOnly" field? hard coded to false for now.
final boolean httpOnly = false;
requestCookies.addCookie(new HarCookie(aCookie.getName(), aCookie.getValue(), aCookie.getPath(), aCookie.getDomain(),
new Date(aCookie.getMaxAge()), httpOnly, aCookie.getSecure(), comment
));
requestCookies.addCookie(new HarCookie(aCookie.getName(), aCookie.getValue()));
}
}
}
Expand Down Expand Up @@ -141,12 +136,7 @@ public static void convertRecordsToHAR(final List<IRequestLogRecord> recordsList
if (headerValue != null && headerName.equalsIgnoreCase("Cookie")) {
List<HttpCookie> parsedCookies = HttpCookie.parse(headerValue);
for (HttpCookie aCookie : parsedCookies) {
// expires = max age
// does HttpCookie support the "httpOnly" field? hard coded to false for now.
final boolean httpOnly = false;
responseCookies.addCookie(new HarCookie(aCookie.getName(), aCookie.getValue(), aCookie.getPath(), aCookie.getDomain(),
new Date(aCookie.getMaxAge()), httpOnly, aCookie.getSecure(), comment
));
responseCookies.addCookie(new HarCookie(aCookie.getName(), aCookie.getValue()));
}
}
}
Expand Down

0 comments on commit 424dab2

Please sign in to comment.