Expand my Community achievements bar.

SOLVED

Dispatcher clientheaders on HTTP error

Avatar

Former Community Member

Hi,

I've a dispatcher configured to enable a list of HTTP headers that Dispatcher passes from the client HTTP request to the renderer.

Configuring Dispatcher

On 2XX HTTP request the headers are present on every response.

The issue is when we try to use the same mechanism on 4XX or 5XX http requests. The dispatcher/apache simply deletes or don't cares to any custom header.

No ErrorDocument or redirect is defined on apache, and mod_headers is not overwritten the headers.

Can you please help?

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Hi Jörg,

Yes we want to add specific headers to 4XX or 5XX responses.

After more digging I find out DispatcherPassError property. After configure it to  DispatcherPassError 300-308,400-431,502-511 dispatcher started to expose our custom errors on 500 and 501 HTTP errors.

Can you just clarify if there any adobe concerns regarding this configuration?

View solution in original post

5 Replies

Avatar

Administrator

Jörg Hoh​ can you have a look at this Dispatcher's issue!!



Kautuk Sahni

Avatar

Employee Advisor

I failed to understand what you want to achieve.

The mentioned configuration only deals with request headers forwarded from the dispatcher to the AEM instance (not with headers AEM attaches to responses). And the dispatcher doesn't know upfront about the status code of the response.

Do you want to add specific headers to 4xx or 5xx responses?

Avatar

Correct answer by
Former Community Member

Hi Jörg,

Yes we want to add specific headers to 4XX or 5XX responses.

After more digging I find out DispatcherPassError property. After configure it to  DispatcherPassError 300-308,400-431,502-511 dispatcher started to expose our custom errors on 500 and 501 HTTP errors.

Can you just clarify if there any adobe concerns regarding this configuration?

Avatar

Employee Advisor

I cannot speak for Adobe, only for myself :-)

It looks ok for me, but I wonder why you need special headers in these responses.

Jörg

Avatar

Former Community Member

Ok thank you for the answer.

500 Status is way to generic to be compliant with all functional error scenarios, so we add more error information, allowing the site to behave properly.

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----