Details
-
Bug
-
Resolution: Unresolved
-
Medium
-
None
-
6.15.7, 7.3.5
-
None
-
7
-
Severity 3 - Minor
-
0
-
Description
Issue Summary
Confluence has a "Share a link" template that allows users to take content from the web and place it in a Confluence page.
Some links that contains space (%20) will not work with the blueprint.
Steps to Reproduce
- Make sure that Confluence has whitelist disabled for this replication
- Create page from blueprint > Choose "Share a link"
- Find a link that cotains space. (Sample link provided on CSP-261395)
- The "Share a link" popup will appear. Paste the sample link on the "Link" field. Example (not a working link)
http://www.example.com/Upload/A%20sample%20doc.PDF
- Add title and click on the "create" button
Expected Results
The page is created
Actual Results
Page is not created. Seeing the following error message on the page:
We can't create that blueprint right now.
The below exception is thrown in the atlassian-confluence.log file:
2019-11-05 10:59:00,803 ERROR [http-nio-26157-exec-1] [plugins.sharelinks.metaextractor.MasterLinkMetaDataExtractor] getHeadHtmlData Error in parse data: -- referer: http://localhost:26157/display/~admin/test | url: /rest/create-dialog/1.0/content-blueprint/create-content | traceId: 877f4973116ffdf8 | userName: admin java.lang.RuntimeException: java.net.URISyntaxException: Illegal character in path at index 9: /Upload/1 Stock Preparation & Approach System 2010.PDF at com.atlassian.confluence.util.http.httpclient.HttpClientHttpResponse.getResponseURI(HttpClientHttpResponse.java:31) at com.atlassian.confluence.plugins.sharelinks.metaextractor.MasterLinkMetaDataExtractor.getResponseURI(MasterLinkMetaDataExtractor.java:151) at com.atlassian.confluence.plugins.sharelinks.metaextractor.MasterLinkMetaDataExtractor.getHeadHtmlData(MasterLinkMetaDataExtractor.java:105) at com.atlassian.confluence.plugins.sharelinks.metaextractor.MasterLinkMetaDataExtractor.parseMetaData(MasterLinkMetaDataExtractor.java:71) .... Caused by: java.net.URISyntaxException: Illegal character in path at index 9: /Upload/A sample doc.PDF at java.net.URI$Parser.fail(URI.java:2848) at java.net.URI$Parser.checkChars(URI.java:3021) ....
Upon checking the browser console, the link is getting 500 error:
Request URL:http://localhost:26157/rest/sharelinks/1.0/link?url=http%3A%2F%2Fwww.example.com.tw%2FUpload%2FA%2520sample%2520doc.PDF&_=1572922738734
Request method:GET
Remote address:127.0.0.1:26157
Status code:
500
Version:HTTP/1.1
Referrer Policy:no-referrer-when-downgrade
Notes
This issue was seen on external PDF links that contains space or %20. More examples can be seen from CSP-261395
The issue does not exists with PDF links that contians spaces from Confluence.
Upon checking, working links are encoded to %2520 in the browser console
Workaround
Before adding the link into the field, change all occurrence of "%20" into "%2520".
Example, the link mentioned above will become the following:
http://www.example.com/Upload/A%2520sample%2520doc.PDF