/clientheaders in dispatcher | Community
Skip to main content
JakeCham
March 12, 2024
Solved

/clientheaders in dispatcher

  • March 12, 2024
  • 3 replies
  • 1658 views

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 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by joerghoh

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.

3 replies

aanchal-sikka
Community Advisor
Community Advisor
March 12, 2024

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-cross-origin-resource-sharing.html?lang=en#allowing-cors-request-headers

/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-and-dispatcher/

Aanchal Sikka
JakeCham
JakeChamAuthor
March 12, 2024

Hi @aanchal-sikka 

 

Can't we give content type like below 
/clientheaders{

"Content-Type" "application/json"

}

 

Or can you give me an example for below

  • Content-Type: define the media type or MIME type of the response content. 
joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
March 18, 2024

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.

arunpatidar
Community Advisor
Community Advisor
March 12, 2024
kautuk_sahni
Community Manager
Community Manager
March 14, 2024

@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.

Kautuk Sahni