apache2.4siteminder

Apache - Convert underscores to dashes in headers


In a project a had to run CA Webagent Siteminder which sends me legacy headers with underscores. Since Apache 2.4 underscores are deprecated and dropped silently.

I need a workaround via mod_headers which converts all underscores _ to dashes - in the request-header.

Before

legacy_header_one
legacy_header_two
legacy_header_three

After

legacy-header-one
legacy-header-two
legacy-header-three

Solution

  • You have two options here:

    1. Apache Bypass

      # 
      # The following works around a client sending a broken Accept_Encoding
      # header.
      #
      SetEnvIfNoCase ^Accept.Encoding$ ^(.*)$ fix_accept_encoding=$1
      RequestHeader set Accept-Encoding %{fix_accept_encoding}e env=fix_accept_encoding
      
    2. Siteminder Bypass

      #its not explicitly stated but im assuming this should be in your WebAgent.conf file
      LegacyVariables="NO"
      

    EDIT:

    I know this doesn't directly answer your question of converting from _ to - but it is an answer to help mitigate the Apache 2.4 vs. CA Siteminder header issue.