File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -520,7 +520,8 @@ public RequestTemplate target(String target) {
520520 }
521521
522522 /* strip the query string */
523- this .target = targetUri .getScheme () + "://" + targetUri .getAuthority () + targetUri .getPath ();
523+ this .target =
524+ targetUri .getScheme () + "://" + targetUri .getRawAuthority () + targetUri .getRawPath ();
524525 if (targetUri .getFragment () != null ) {
525526 this .fragment = "#" + targetUri .getFragment ();
526527 }
Original file line number Diff line number Diff line change @@ -524,6 +524,14 @@ public void fragmentShouldNotBeEncodedInTarget() {
524524 assertThat (template .url ()).isEqualTo ("https://example.com/path?key1=value1#fragment" );
525525 }
526526
527+ @ Test
528+ public void urlEncodingRemainsInPlace () {
529+ RequestTemplate template =
530+ new RequestTemplate ().method (HttpMethod .GET ).target ("https://exa%23mple.com/path%7Cpath" );
531+
532+ assertThat (template .url ()).isEqualTo ("https://exa%23mple.com/path%7Cpath" );
533+ }
534+
527535 @ Test
528536 public void slashShouldNotBeAppendedForMatrixParams () {
529537 RequestTemplate template =
You can’t perform that action at this time.
0 commit comments