From 2820ff8fb8192a168689e9d1fda6494b64b1c940 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 30 Jul 2024 14:28:46 +1200 Subject: [PATCH] Add change log Signed-off-by: Thomas Farr --- CHANGELOG.md | 1 + .../java/org/opensearch/client/util/PathEncoder.java | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6093bfe19..94fe345f44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ This section is for maintaining a changelog for all breaking changes for the cli ### Dependencies ### Changed +- Changed URL path encoding to own implementation adapted from Apache HTTP Client 5's ([#1109](https://github.com/opensearch-project/opensearch-java/pull/1109)) ### Deprecated diff --git a/java-client/src/main/java/org/opensearch/client/util/PathEncoder.java b/java-client/src/main/java/org/opensearch/client/util/PathEncoder.java index 2574aaa26a..04fd89e3f0 100644 --- a/java-client/src/main/java/org/opensearch/client/util/PathEncoder.java +++ b/java-client/src/main/java/org/opensearch/client/util/PathEncoder.java @@ -9,12 +9,18 @@ package org.opensearch.client.util; public class PathEncoder { - public static final PercentCodec DEFAULT_CODEC = PercentCodec.RFC3986_UNRESERVED; /** * Percent encoding codec that matches Apache HTTP Client 4's path segment encoding. */ @Deprecated - public static final PercentCodec APACHE_HTTP_CLIENT_4_COMPAT = PercentCodec.RFC3986_PATHSAFE; + public static final PercentCodec APACHE_HTTP_CLIENT_4_EQUIV_CODEC = PercentCodec.RFC3986_PATHSAFE; + /** + * Percent encoding codec that matches Apache HTTP Client 5's path segment encoding. + */ + public static final PercentCodec APACHE_HTTP_CLIENT_5_EQUIV_CODEC = PercentCodec.RFC3986_UNRESERVED; + + public static final PercentCodec DEFAULT_CODEC = APACHE_HTTP_CLIENT_5_EQUIV_CODEC; + private static PercentCodec codec; public static PercentCodec getCodec() {