Urls to images attached to pages with '/' character in title are invalid when converting storage to view

XMLWordPrintable

    • Severity 3 - Minor

      When generating the download urls for images in export_view, the '/' characters in page titles don't seem to be escaped correctly. Even when manually escaping this character, the image cannot be downloaded using the resulting url.

      Steps to reproduce:

      1. Create a page called 'a/b'
      2. Attach an image called 'test.jpg' to it.
      3. Call the storage to view conversion service (fix the page ID):
        POST jens-k15t.atlassian.net/wiki/rest/api/contentbody/convert/export_view
        {
            "value" : "<p><ac:image ac:height=\"250\"><ri:attachment ri:filename=\"test.jpg\" /></ac:image></p>",
            "representation" : "storage",
          	"content":{"id":"22413329"}
        }
        
      4. Returned HTML:
        <p>
            <span class="confluence-embedded-file-wrapper confluence-embedded-manual-size">
                <img class="confluence-embedded-image" height="250" src="https://jens-k15t.atlassian.net/wiki/download/attachments/embedded-page/INT/a/b/test.jpg?api=v2">
            </span>
        </p>
        
      5. The image can not be loaded using this url, check out the part with the filename: .../embedded-page/INT/a/b/test.jpg

            Assignee:
            Leo Huang (Inactive)
            Reporter:
            Jens Henrik Jens Henrik
            Votes:
            3 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: