Skip to content

Commit 6c63fce

Browse files
committed
Use ALL_RESERVED as a default
1 parent bca8af6 commit 6c63fce

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

httpcore5/src/main/java/org/apache/hc/core5/net/URIBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public static URIBuilder loopbackAddress() {
8787
private Charset charset;
8888
private String fragment;
8989
private String encodedFragment;
90-
private EncodingPolicy encodingPolicy = EncodingPolicy.RFC_3986;
90+
private EncodingPolicy encodingPolicy = EncodingPolicy.ALL_RESERVED;
9191

9292
private boolean plusAsBlank;
9393

httpcore5/src/test/java/org/apache/hc/core5/net/TestURIBuilder.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,7 @@ void testFragmentEncoding() throws Exception {
996996
.setScheme("http")
997997
.setHost("example.com")
998998
.setFragment(fragment)
999+
.setEncodingPolicy(URIBuilder.EncodingPolicy.RFC_3986)
9991000
.build();
10001001

10011002
Assertions.assertEquals(expectedEncodedFragment, uri.getRawFragment());
@@ -1010,6 +1011,7 @@ void testCustomQueryEncoding() throws Exception {
10101011
.setScheme("http")
10111012
.setHost("example.com")
10121013
.setCustomQuery(query)
1014+
.setEncodingPolicy(URIBuilder.EncodingPolicy.RFC_3986)
10131015
.build();
10141016

10151017
Assertions.assertEquals(expectedEncodedQuery, uri.getRawQuery());

0 commit comments

Comments
 (0)