HADOOP-15681. AuthenticationFilter should generate valid date format for Set-Cookie header regardless of default Locale. Contributed by Cao Manh Dat.
(cherry picked from commit e20b19543b
)
This commit is contained in:
parent
5c1f91fd97
commit
490b18fd4f
|
@ -681,7 +681,7 @@ public class AuthenticationFilter implements Filter {
|
||||||
if (expires >= 0 && isCookiePersistent) {
|
if (expires >= 0 && isCookiePersistent) {
|
||||||
Date date = new Date(expires);
|
Date date = new Date(expires);
|
||||||
SimpleDateFormat df = new SimpleDateFormat("EEE, " +
|
SimpleDateFormat df = new SimpleDateFormat("EEE, " +
|
||||||
"dd-MMM-yyyy HH:mm:ss zzz");
|
"dd-MMM-yyyy HH:mm:ss zzz", Locale.US);
|
||||||
df.setTimeZone(TimeZone.getTimeZone("GMT"));
|
df.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||||
sb.append("; Expires=").append(df.format(date));
|
sb.append("; Expires=").append(df.format(date));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue