Uploaded image for project: 'Cache Modules'
  1. Cache Modules
  2. MGNLCACHE-229

Cached REST Responses lose Content-Type header

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • 5.6, 5.6.2
    • None

      REST Responses stored and replayed from cache don't keep their original Content-Type header. This problem exists in Magnolia 5.7 and 6+.
      If requests bypass the cache the Content-Type is set correctly, but if the response is stored in cache and then replayed the Content-Type header is lost.

      For us this only happens for JSON responses we serve from a REST endpoint, but i think this happens to every response without an extension.

      I think the problem is caused by the replay function in ContentCachedEntry.java. Here, the content type is always overwritten regardless of the current value of the response. If getContentType() returns a null value the original Content-Type will always be deleted.

        Acceptance criteria

              Unassigned Unassigned
              Holo Horst L
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD