Skip to content

Commit

Permalink
Merge pull request #5166 from eclipse-ee4j/mojarra_issue_5165
Browse files Browse the repository at this point in the history
Fix #5165
  • Loading branch information
BalusC authored Nov 12, 2022
2 parents e651989 + 84b2978 commit 6d40d92
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions impl/src/main/java/com/sun/faces/context/ExternalContextImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,16 @@ public class ExternalContextImpl extends ExternalContext {
private boolean distributable;

private enum PREDEFINED_COOKIE_PROPERTIES {
domain, maxAge, path, secure, httpOnly
domain, maxAge, path, secure, httpOnly, attribute;

static PREDEFINED_COOKIE_PROPERTIES of(String key) {
try {
return valueOf(key);
}
catch (IllegalArgumentException ignore) {
return attribute;
}
}
}

static final Class theUnmodifiableMapClass = Collections.unmodifiableMap(new HashMap<>()).getClass();
Expand Down Expand Up @@ -762,7 +771,7 @@ public void addResponseCookie(String name, String value, Map<String, Object> pro
if (properties != null && properties.size() != 0) {
for (Map.Entry<String, Object> entry : properties.entrySet()) {
String key = entry.getKey();
PREDEFINED_COOKIE_PROPERTIES p = PREDEFINED_COOKIE_PROPERTIES.valueOf(key);
PREDEFINED_COOKIE_PROPERTIES p = PREDEFINED_COOKIE_PROPERTIES.of(key);
Object v = entry.getValue();
switch (p) {
case domain:
Expand Down

0 comments on commit 6d40d92

Please sign in to comment.