AEM as a Cloud Service: Resolving inconsistent Content-Type headers for JSON endpoints
This article explains how to resolve inconsistent Content-Type response headers for JSON endpoints in Adobe Experience Manager as a Cloud Service that occur after certain maintenance releases.
Description description
Environment
Adobe Experience Manager as a Cloud Service (AEMaaCS), specifically maintenance releases 27083 through 27293.
Symptoms
After applying certain AEMaaCS maintenance releases, requests to JSON endpoints (For example: endpoints matching the pattern /bin/[ your-path] /[ resource] .json) return inconsistent Content-Type headers. Some responses have Content-Type: application/json, while others return Content-Type: text/plain. This inconsistency causes failures in website features and downstream integrations that expect a consistent Content-Type value, potentially resulting in missing content or images on web pages.
Cause
The root cause wasn’t definitively identified, but the timing of the issue aligns with the deployment of AEMaaCS maintenance releases 27083–27293. No documented change in these releases directly explains the change in Content-Type behavior. The issue was mitigated by overriding the Content-Type header at the CDN layer.
Resolution resolution
Follow the steps below to resolve the issue:
-
Review recent AEM maintenance releases:
-
Check the release notes for AEM as a Cloud Service maintenance releases 27083 through 27293 for any changes related to HTTP response handling or Content-Type header defaults.
-
Release notes are located in Experience League under the AEM as a Cloud Service maintenance release documentation.
-
-
Implement a response header override at the CDN layer (if immediate mitigation is needed):
-
If your downstream applications require a specific Content-Type (such as text/plain), configure your CDN to override the Content-Type header for affected endpoints.
-
Example generic CDN configuration:
-
Create a response transformation rule that matches requests to the relevant JSON endpoints (For example: paths matching
/bin/[ your-path] /[ resource] .json). -
Set the Content-Type response header to the required value (For example: text/plain; charset=UTF-8).
-
-
Validate application and integration expectations:
- Confirm whether downstream systems require a specific Content-Type and update application logic, if possible, to handle both text/plain and application/json.
-
Monitor for further changes:
- Track future AEM maintenance releases for any updates or fixes related to servlet response handling or Content-Type negotiation.
-
Verification:
- After applying the CDN override, test the affected endpoints to ensure the Content-Type header is consistently set as required and that downstream applications function as expected.