Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-8162

Image URI with spaces cause CsrfTokenSecurityFilter#generateCookie to fail

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Neutral Neutral
    • None
    • 6.2.12
    • None

      If request.getServletPath() contains spaces, then URI(path) throws

      Exception in thread "main" java.net.URISyntaxException: Illegal character in path at index 51: /dam/jcr:d0836006-76be-458d-baa0-fd03ee061e57/image name with spaces.jpg
      	at java.base/java.net.URI$Parser.fail(URI.java:2913)
      	at java.base/java.net.URI$Parser.checkChars(URI.java:3084)
      	at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3166)
      	at java.base/java.net.URI$Parser.parse(URI.java:3125)
      	at java.base/java.net.URI.<init>(URI.java:600)
      	at Scratch.main(Scratch.java:14)
      

      Wondering why image links use asset name instead of JCR name (which has spaces replaced with dash). Possibly for SEO reasons? 

      At any rate, solving MAGNOLIA-8150 would likely make this issue obsolete. 

      Workaround:

      • Add bypasses for /dam and /.imaging URIs

        Acceptance criteria

              Unassigned Unassigned
              fgrilli Federico Grilli
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD