Hi Team,
/clientheaders in dispatcher is used for validation the headers or just adding headers into request headers ? As well as please give me an example how to add content type or cross origin policies through clientheaders ?
Thanks
Solved! Go to Solution.
Views
Replies
Total Likes
With this configuration you can just define the name of the HTTP header, which is copied over from the request the user made to the dispatcher into the request the dispatcher makes to AEM. You cannot add custom headers with specific values into the request to AEM with this configuration parameter.
Hello @JakeCham
The /clientheaders is meant to define the headers that can pass-through from client to AEM.
For content-type refer to following:
/clientheaders {
# Retain any existing headers
"CSRF-Token"
"X-Forwarded-Proto"
"referer"
"user-agent"
"authorization"
"from"
"content-type"
....
}
For CORS, please refer to https://experienceleague.adobe.com/docs/experience-manager-learn/foundation/security/understand-cros...
/clientheaders {
...
"Origin"
"Access-Control-Request-Method"
"Access-Control-Request-Headers"
}
Example for custom-header is available on: https://techrevel.blog/2023/09/05/exploring-aem-request-and-response-headers-analysis-of-browser-cdn...
Can't we give content type like below
/clientheaders{
"Content-Type" "application/json"
}
Or can you give me an example for below
With this configuration you can just define the name of the HTTP header, which is copied over from the request the user made to the dispatcher into the request the dispatcher makes to AEM. You cannot add custom headers with specific values into the request to AEM with this configuration parameter.
@JakeCham Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies