jira-importer opened a new issue, #1265:
URL: https://github.com/apache/httpcomponents-core/issues/1265

   **[Jared 
Jacobs](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=jaredjacobs)**
 opened 
**[HTTPCORE-787](https://issues.apache.org/jira/browse/HTTPCORE-787?redirect=false)**
 and commented
   
   When a path contains escaped characters, `getPath()` incorrectly returns 
them unescaped.
   
   Note that `toString()` correctly returns the characters escaped. `getPath()` 
should behave like `toString()` in this regard.
   
   ```java
   @Test
   void testUriBuilder() throws URISyntaxException {
       String path = "/a/b/zzz%2Fzzz/c/d";
       assertEquals(new URIBuilder(path).toString(), path);
       assertEquals(new URIBuilder(path).getPathSegments(), List.of("a", "b", 
"zzz/zzz", "c", "d"));
       assertEquals(new URIBuilder(path).getPath(), path);
   } 
   ```
   
   The last `assertEquals` above fails with:
   
   > `Expected: /a/b/zzz%2Fzzz/c/d`
   > `Actual:   /a/b/zzz/zzz/c/d`
   
   As you can see, failing to escape path segments can break a URL by, for 
example, introducing new path segments by subdividing a path segment with new 
(unescaped) slashes.
   
   
   ---
   
   **Affects:** 5.3.6
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to