File tree 1 file changed +5
-1
lines changed
spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -378,10 +378,10 @@ private String getCookieHeader(Cookie cookie) {
378
378
buf .append ("; Domain=" ).append (cookie .getDomain ());
379
379
}
380
380
int maxAge = cookie .getMaxAge ();
381
+ ZonedDateTime expires = (cookie instanceof MockCookie ? ((MockCookie ) cookie ).getExpires () : null );
381
382
if (maxAge >= 0 ) {
382
383
buf .append ("; Max-Age=" ).append (maxAge );
383
384
buf .append ("; Expires=" );
384
- ZonedDateTime expires = (cookie instanceof MockCookie ? ((MockCookie ) cookie ).getExpires () : null );
385
385
if (expires != null ) {
386
386
buf .append (expires .format (DateTimeFormatter .RFC_1123_DATE_TIME ));
387
387
}
@@ -391,6 +391,10 @@ private String getCookieHeader(Cookie cookie) {
391
391
buf .append (headers .getFirst (HttpHeaders .EXPIRES ));
392
392
}
393
393
}
394
+ else if (expires != null ) {
395
+ buf .append ("; Expires=" );
396
+ buf .append (expires .format (DateTimeFormatter .RFC_1123_DATE_TIME ));
397
+ }
394
398
395
399
if (cookie .getSecure ()) {
396
400
buf .append ("; Secure" );
You can’t perform that action at this time.
0 commit comments