ok2c commented on a change in pull request #136: HTTPCLIENT-1968
URL: 
https://github.com/apache/httpcomponents-client/pull/136#discussion_r256863307
 
 

 ##########
 File path: httpclient/src/main/java/org/apache/http/client/utils/URIUtils.java
 ##########
 @@ -45,6 +46,51 @@
  */
 public class URIUtils {
 
+    /**
+     * Flags that control how URI is being rewritten.
+     *
+     * @since 5.7.8
+     */
+    public enum UriFlag {
+        DROP_FRAGMENT,
+        NORMALIZE
+    }
+
+    /**
+     * Empty set of uri flags.
+     *
+     * @since 5.7.8
+     */
+    public static final EnumSet<UriFlag> NO_FLAGS = 
EnumSet.noneOf(UriFlag.class);
+
+    /**
+     * Set of uri flags containing {@link UriFlag#DROP_FRAGMENT}.
+     *
+     * @since 5.7.8
+     */
+    public static final EnumSet<UriFlag> DROP_FRAGMENT = 
EnumSet.of(UriFlag.DROP_FRAGMENT);
+
+    /**
+     * Set of uri flags containing {@link UriFlag#NORMALIZE}.
+     *
+     * @since 5.7.8
+     */
+    public static final EnumSet<UriFlag> NORMALIZE = 
EnumSet.of(UriFlag.NORMALIZE);
+
+    /**
+     * Set of uri flags containing {@link UriFlag#DROP_FRAGMENT} and {@link 
UriFlag#NORMALIZE}.
+     *
+     * @since 5.7.8
+     */
+    public static final EnumSet<UriFlag> DROP_FRAGMENT_AND_NORMALIZE = 
EnumSet.of(UriFlag.DROP_FRAGMENT, UriFlag.NORMALIZE);
+
+    /**
+     * These uri flags are to be used in deprecated codebase only, and are set 
to mimic "legacy" behaviour.
+     *
+     * @since 5.7.8
+     */
+    public static final EnumSet<UriFlag> LEGACY_BEHAVIOR = 
DROP_FRAGMENT_AND_NORMALIZE;
 
 Review comment:
   @cstamas Could the term `LEGACY` be avoided here? As far as I am concerned 
this is the intended default behavior.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to