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

Cached REST Responses lose Content-Type header

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.6, 5.6.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response: