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

   **[Philipp 
Schusser](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=JIRAUSER299967)**
 opened 
**[HTTPCORE-742](https://issues.apache.org/jira/browse/HTTPCORE-742?redirect=false)**
 and commented
   
   If the requestUri of a BasicHttpRequest isn’t null and needs to be set to a 
new value using setUri(newUri), e.g. because a parameter needs to be added to 
an existing URI, path is changed but not requestUri itself. Thus, the repeated 
query with getUri() returns the initially set value.
   
   I assume this could be fixed by setting the requestURI to null at the end of 
setUri(), as it is done in the other setters. This way it would be reassembled 
correctly next time it is queried, without caching.
   
   ```java
   URI uri = URI.create("http://example.org";);
   HttpGet req = new HttpGet(uri);
   System.out.println(req.getUri());
   URI newUri = URI.create("http://not-example.org";);
   req.setUri(newUri);
   System.out.println(req.getUri() == newUri); // would expect true 
   ```
   
   
   
   ---
   
   **Affects:** 5.2, 5.2.1
   
   **Attachments:**
   - 
[TestBasicHttpRequest.java](https://issues.apache.org/jira/secure/attachment/13057660/TestBasicHttpRequest.java)
 (_854 bytes_)
   
   **Backported to:** 
[5.2.2](https://github.com/apache/httpcomponents-core/milestone/88?closed=1)
   


-- 
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