Tapestry
  1. Tapestry
  2. TAPESTRY-1282

Assets should be streamed with an appropriate content type, even when the container is unable to provide the content type

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0
    • Fix Version/s: 5.0.3
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      In ResourceStreamerImpl#streamResource(Resource), the content type returned for Tapestry's default CSS file is "content/unknown". However, when using a strict HTML 4 doctype, Firefox does not use the CSS rules defined in the file unless the content type is "text/css".

      1. css-content-type.patch
        0.6 kB
        Daniel Gredler
      2. css-content-type-2.patch
        7 kB
        Daniel Gredler
      3. test.gif
        3 kB
        Daniel Gredler

        Activity

        Daniel Gredler created issue -
        Hide
        Daniel Gredler added a comment -

        Attaching small patch which I've applied locally to fix this issue.

        Show
        Daniel Gredler added a comment - Attaching small patch which I've applied locally to fix this issue.
        Daniel Gredler made changes -
        Field Original Value New Value
        Attachment css-content-type.patch [ 12351530 ]
        Hide
        Daniel Gredler added a comment -

        Attaching a better patch, including unit tests, and the test gif used in one of the tests.

        Show
        Daniel Gredler added a comment - Attaching a better patch, including unit tests, and the test gif used in one of the tests.
        Daniel Gredler made changes -
        Attachment test.gif [ 12352886 ]
        Attachment css-content-type-2.patch [ 12352885 ]
        Howard M. Lewis Ship made changes -
        Assignee Howard M. Lewis Ship [ hlship ]
        Hide
        Howard M. Lewis Ship added a comment -

        Thanks for the patch; I've made some minor improvements, such as basing the file extension to content type mapping as a mapped service configuration. Added bonus: you can name for your file FOO.CSS and it still works (mapped configurations where the keys are strings are automatically case insensitive).

        Show
        Howard M. Lewis Ship added a comment - Thanks for the patch; I've made some minor improvements, such as basing the file extension to content type mapping as a mapped service configuration. Added bonus: you can name for your file FOO.CSS and it still works (mapped configurations where the keys are strings are automatically case insensitive).
        Howard M. Lewis Ship made changes -
        Component/s tapestry-core [ 12311285 ]
        Fix Version/s 5.0.3 [ 12312338 ]
        Summary CSS assets served with incorrect content type Assets should be streamed with an appropriate content type, even when the container is unable to provide the content type
        Fix Version/s 5.0 [ 12312018 ]
        Howard M. Lewis Ship made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Howard M. Lewis Ship committed 517492 (1 file)
        Reviews: none

        TAPESTRY-1282: Assets should be streamed with an appropriate content type, even when the container is unable to provide the content type

        Mark Thomas made changes -
        Workflow jira [ 12397792 ] Default workflow, editable Closed status [ 12568075 ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12568075 ] jira [ 12591173 ]

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Daniel Gredler
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development