ADC-13.1-Error "Custom header name is too long" with rewrite action DELETE_HTTP_HEADER in Netscaler

ADC-13.1-Error "Custom header name is too long" with rewrite action DELETE_HTTP_HEADER in Netscaler

book

Article ID: CTX617007

calendar_today

Updated On:

Description

When you want to delete HTTP header "X-Permitted-Cross-Domain-Policies" with rewrite action DELETE_HTTP_HEADER, Netscaler prompts this error "Custom header name is too long".

Resolution

We can use the following commands as a workaround.
 
add rewrite action delete_header-act delete_all HTTP.RES.FULL_HEADER -search q/regex(re~X-Permitted-Cross-Domain-Policies.*?\r\n~)/

add rewrite policy delete_header_pol "HTTP.RES.FULL_HEADER.CONTAINS(\"X-Permitted-Cross-Domain-Policies\")" delete_header-act
=>If "X-Permitted-Cross-Domain-Policies" is involved in the HTTP response headers , then the rewrite policy will hit.

bind lb vserver -policyName delete_header_pol -priority 100 -gotoPriorityExpression NEXT -type RESPONSE
 =>"X-Permitted-Cross-Domain-Policies" is a response header, so we need to bind the rewrite policy to RESPONSE type.

 

Problem Cause

Currently, the header name length is limited to 32 characters in Netcaler for rewrite action DELETE_HTTP_HEADER and INSERT_HTTP_HEADER.
It is by-design to see error "Custom header name is too long"  when we try to delete header name like "X-Permitted-Cross-Domain-Policies" which has more than 32 characters.