Wicket
  1. Wicket
  2. WICKET-4306

Content type overriding in PackageResource

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5.3
    • Fix Version/s: 1.5.4, 6.0.0-beta1
    • Component/s: wicket
    • Labels:
      None

      Description

      Hello,

      From my email on the dev@ list:
      "
      In a Resource extending PackageResource (a LessCSS implementation), we
      set the content type on the ResourceStream to text/css.

      The problem is that PackageResource overrides it in
      newResourceResponse (starting from line 255 in 1.5.3):
      final String contentType;
      if (Application.exists())

      { contentType = Application.get().getMimeType(path); }

      else

      { contentType = resourceStream.getContentType(); }

      If not null, shouldn't we give the resourceStream's content type a
      higher priority and use Application.get().getMimeType(path) only if it
      is null?

      IMHO we should probably have something like that:
      final String contentType = resourceStream.getContentType();
      if (contentType == null && Application.exists())

      { contentType = Application.get().getMimeType(path); }

      "

      Thanks.


      Guillaume

        Activity

        Guillaume Smet created issue -
        Martin Grigorov made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Martin Grigorov [ mgrigorov ]
        Fix Version/s 1.5.4 [ 12319051 ]
        Fix Version/s 6.0.0 [ 12315431 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Guillaume Smet
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development