On these below, the @since are off. Gary
On Sat, Feb 16, 2019 at 5:55 AM <[email protected]> wrote: > This is an automated email from the ASF dual-hosted git repository. > > olegk pushed a commit to branch 4.5.x > in repository > https://gitbox.apache.org/repos/asf/httpcomponents-client.git > > > The following commit(s) were added to refs/heads/4.5.x by this push: > new 4093a30 HTTPCLIENT-1968: Make normalization of URI paths optional > new ae9ea60 Merge pull request #136 from cstamas/HTTPCLIENT-1968 > 4093a30 is described below > > commit 4093a3015d6b789888077e317e535df4c8102e5d > Author: Tamas Cservenak <[email protected]> > AuthorDate: Sat Feb 16 11:50:11 2019 +0100 > > + /** > + * 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); > + > /** > * Constructs a {@link URI} using all the parameters. This should > be > * used instead of > @@ -125,12 +164,40 @@ public class URIUtils { > * > * @throws URISyntaxException > * If the resulting URI is invalid. > + * @deprecated (5.7.8) Use {@link #rewriteURI(URI, HttpHost, EnumSet)} > + */ > + @Deprecated > + public static URI rewriteURI( > + final URI uri, > + final HttpHost target, > + final boolean dropFragment) throws URISyntaxException > + { > + return rewriteURI(uri, target, dropFragment ? DROP_FRAGMENT : > NO_FLAGS); > + } > + > + /** > + * A convenience method for creating a new {@link URI} whose scheme, > host > + * and port are taken from the target host, but whose path, query and > + * fragment are taken from the existing URI. What exactly is used and > how > + * is driven by the passed in flags. The path is set to "/" if not > explicitly specified. > + * > + * @param uri > + * Contains the path, query and fragment to use. > + * @param target > + * Contains the scheme, host and port to use. > + * @param flags > + * True if the fragment should not be copied. > + * > + * @throws URISyntaxException > + * If the resulting URI is invalid. > + * @since 5.7.8 > */ >
