Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-1392

SVG assets rended with wrong content type

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.2
    • Fix Version/s: 5.3
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      When svg image added to page like asset in img tag, it is rended with application/xml content type instead of image/svg+xml, so that browsers doesn't show it.
      When it is added to page as static resource all is ok.

      The problem is in this code (StreamableResourceImpl):

      URLConnection connection = url.openConnection();
      contentType = connection.getContentType();

      it returns application/xml, while code below will return image/svg+xml:

      servletContext.getMimeType(resource.getPath());

      Tested with Jetty6 + Chrome8,Opera11

        Attachments

          Activity

            People

            • Assignee:
              hlship Howard M. Lewis Ship
              Reporter:
              sody Ivan Khalopik
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: