You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2020/08/05 09:23:00 UTC
[jira] [Commented] (HTTPCORE-627) URIBuilder::Adding query
parameters result in removing the scheme specific part of an URI
[ https://issues.apache.org/jira/browse/HTTPCORE-627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17171370#comment-17171370 ]
ASF subversion and git services commented on HTTPCORE-627:
----------------------------------------------------------
Commit a5d649c6d8b50ef5ebdeaeaebe6ad4c083fa0152 in httpcomponents-core's branch refs/heads/5.1.x from TorstenR
[ https://gitbox.apache.org/repos/asf?p=httpcomponents-core.git;h=a5d649c ]
HTTPCORE-627: Adding query parameters causes removal of the scheme specific part of URI by URIBuilder (#196)
> URIBuilder::Adding query parameters result in removing the scheme specific part of an URI
> -----------------------------------------------------------------------------------------
>
> Key: HTTPCORE-627
> URL: https://issues.apache.org/jira/browse/HTTPCORE-627
> Project: HttpComponents HttpCore
> Issue Type: Improvement
> Components: HttpCore
> Affects Versions: 5.0
> Environment: Java EE; Vaadin; Glassfish 5
> Reporter: Torsten Rendelmann
> Priority: Minor
> Fix For: 5.1
>
> Time Spent: 1h
> Remaining Estimate: 0h
>
> We use the URIBuilder in our Vaadin projects to build URIs that are used at client site (Browser).
> For that we built a URI using URIBuilder with the special scheme "mailto:", the e-Mail address of the receiver and some URL query parameters to suggest the mail subject and body content.
> The final URL should look like that:
> {code:java}
> mailto:user@mail.server?subject=mail%20subject&body=mail%20body
> {code}
> We were not able to create that using the URIBuilder. Here is our approach as a unit test:
> {code:java}
> @Test
> public void checkURIBuilderMailtoURLs() throws Exception {
> final URIBuilder uribuilder = new URIBuilder("mailto:my@email.server").setParameter("subject", "mail subject");
> final String result = uribuilder.build().toString();
> Assert.assertTrue("mail address as scheme specific part expected", result.contains("my@email.server"));
> Assert.assertTrue("correct parameter encoding expected for that scheme", result.contains("mail%20subject"));
> }
> {code}
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org