I am trying to set a custom response header in my jsp via:
<% response.setHeader("my-custom-header", "custom-value"); %>
When I access the page directly through the Publisher, I can see the header being set. However, when I hit the same page through the Dispatcher, the header is not there.
I checked the dispatcher.any file and the /clientheaders property is set to "*" to let all headers through.
Would any one know why the header is not present when accessing through the Dispatcher?
Thanks!
Solved! Go to Solution.
Views
Replies
Total Likes
What you can do is to not cache that particular page, then the response headers will come through.
Otherwise the new option to cache the response header is the way to go.
Views
Replies
Total Likes
Hi,
if you want a custom header to be passed in every request comes to AEM instance, then do the follow steps
for more details, follow this link https://docs.adobe.com/docs/en/dispatcher/disp-config.html#par_114_12_0005
If you want every http request to have your custom header even to request is not being served from AEM publish server then you need to do the configuration at the web server level.
Hope this helps. Let me know if you get this things resolved.
daitienshi wrote...
I am trying to set a custom response header in my jsp via:
<% response.setHeader("my-custom-header", "custom-value"); %>
When I access the page directly through the Publisher, I can see the header being set. However, when I hit the same page through the Dispatcher, the header is not there.
I checked the dispatcher.any file and the /clientheaders property is set to "*" to let all headers through.
Would any one know why the header is not present when accessing through the Dispatcher?
Thanks!
Views
Replies
Total Likes
By default headers won't be cached by the dispatcher.
You can configure this via the /headers section inside the cache configuration.
Views
Replies
Total Likes
Thanks!
However, we only need this custom response header on a particular page and it seems like overkill to have to enter all possible default headers and then this one custom one under /clientheaders. Also, my understanding is that the /clientheaders is for allowing which request headers to allow through, whereas I'm looking to get a custom response header through the dispatcher.
Thoughts?
Thanks again!
Views
Replies
Total Likes
Does this apply to both request and response headers?
Feike Visser wrote...
By default headers won't be cached by the dispatcher.
You can configure this via the /headers section inside the cache configuration.
Views
Replies
Total Likes
Only response headers.
Views
Replies
Total Likes
What you can do is to not cache that particular page, then the response headers will come through.
Otherwise the new option to cache the response header is the way to go.
Views
Replies
Total Likes
Views
Replies
Total Likes
Did you got the solution ?
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies