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 @@ -518,7 +518,7 @@ public RequestTemplate target(String target) {
518518 }
519519
520520 /* strip the query string */
521- this .target = targetUri .getScheme () + "://" + targetUri .getAuthority () + targetUri .getPath ();
521+ this .target = targetUri .getScheme () + "://" + targetUri .getRawAuthority () + targetUri .getRawPath ();
522522 if (targetUri .getFragment () != null ) {
523523 this .fragment = "#" + targetUri .getFragment ();
524524 }
Original file line number Diff line number Diff line change @@ -514,6 +514,15 @@ public void fragmentShouldNotBeEncodedInTarget() {
514514 assertThat (template .url ()).isEqualTo ("https://example.com/path?key1=value1#fragment" );
515515 }
516516
517+ @ Test
518+ public void urlEncodingRemainsInPlace () {
519+ RequestTemplate template = new RequestTemplate ()
520+ .method (HttpMethod .GET )
521+ .target ("https://exa%23mple.com/path%7Cpath" );
522+
523+ assertThat (template .url ()).isEqualTo ("https://exa%23mple.com/path%7Cpath" );
524+ }
525+
517526 @ Test
518527 public void slashShouldNotBeAppendedForMatrixParams () {
519528 RequestTemplate template = new RequestTemplate ().method (HttpMethod .GET )
You can’t perform that action at this time.
0 commit comments