Merge pull request #6490 from eclipse/jetty-10.0.x-6489-UriCompliance

Issue #6489 - fix RFC3986_UNAMBIGUOUS and UNSAFE UriCompliance modes.
This commit is contained in:
Lachlan 2021-07-06 15:58:51 +10:00 committed by GitHub
commit 259f9af9c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;
@ -150,10 +150,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, STRICT, SAFE))
for (UriCompliance compliance : KNOWN_MODES)
{
if (compliance.getName().equals(name))
return compliance;