Issue #6489 - fix RFC3986_UNAMBIGUOUS and UNSAFE UriCompliance modes.

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
Lachlan Roberts 2021-07-01 17:52:07 +10:00
parent b82b46243d
commit 76ab749aca
1 changed files with 3 additions and 2 deletions

View File

@ -13,8 +13,8 @@
package org.eclipse.jetty.http;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
@ -156,10 +156,11 @@ public final class UriCompliance implements ComplianceViolation.Mode
public static final UriCompliance STRICT = new UriCompliance("STRICT", RFC3986.getAllowed());
private static final AtomicInteger __custom = new AtomicInteger();
private static final List<UriCompliance> KNOWN_MODES = List.of(DEFAULT, LEGACY, RFC3986, RFC3986_UNAMBIGUOUS, UNSAFE, SAFE, STRICT);
public static UriCompliance valueOf(String name)
{
for (UriCompliance compliance : Arrays.asList(DEFAULT, LEGACY, RFC3986, RFC3986_UNAMBIGUOUS, UNSAFE, SAFE, STRICT))
for (UriCompliance compliance : KNOWN_MODES)
{
if (compliance.getName().equals(name))
return compliance;