Skip to content

Commit 6056359

Browse files
committed
Changed addCookie method not to return a Max-Age or Expires property if the maxAge is < 0. This is tested with a browser and should finally close #51
1 parent 6bd4f76 commit 6056359

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

aws-serverless-java-container-core/src/main/java/com/amazonaws/serverless/proxy/internal/servlet/AwsHttpServletResponse.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,10 @@ public void addCookie(Cookie cookie) {
9696
if (cookie.getDomain() != null && !"".equals(cookie.getDomain().trim())) {
9797
cookieData += "; Domain=" + cookie.getDomain();
9898
}
99-
cookieData += "; Max-Age=" + cookie.getMaxAge();
10099

101100
if (cookie.getMaxAge() > 0) {
101+
cookieData += "; Max-Age=" + cookie.getMaxAge();
102+
102103
// we always set the timezone to GMT
103104
TimeZone gmtTimeZone = TimeZone.getTimeZone(COOKIE_DEFAULT_TIME_ZONE);
104105
Calendar currentTimestamp = Calendar.getInstance(gmtTimeZone);

0 commit comments

Comments
 (0)