4

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
Roman
  • 2,530
  • 2
  • 27
  • 50

2 Answers2

2

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.

John Rausch
  • 186
  • 2
  • 5
0

In your virtualhost config:

SetEnvIfNoCase ^OAM.REMOTE.USER$ ^(.*)$ fix_accept_encoding=$1
RequestHeader set OAM-REMOTE-USER %{fix_accept_encoding}e env=fix_accept_encoding

If you are using mod_wsgi for Django or Flask, you will need to add:

WSGIPassAuthorization On

lax1089
  • 3,403
  • 3
  • 17
  • 37