Apache2.4 Apache-将标题中的下划线转换为破折号

Apache2.4 Apache-将标题中的下划线转换为破折号,apache2.4,siteminder,Apache2.4,Siteminder,在一个项目中,a必须运行CA Webagent Siteminder,它会向我发送带有下划线的旧标题。由于Apache2.4不推荐使用下划线,因此会自动删除下划线 我需要通过mod\u headers来解决问题,它将请求头中的所有下划线转换为破折号- 之前 legacy_header_one legacy_header_two legacy_header_three 之后 legacy-header-one legacy-header-two legacy-header-three 在vir

在一个项目中,a必须运行CA Webagent Siteminder,它会向我发送带有下划线的旧标题。由于Apache2.4不推荐使用下划线,因此会自动删除下划线

我需要通过
mod\u headers
来解决问题,它将请求头中的所有下划线
转换为破折号
-

之前

legacy_header_one
legacy_header_two
legacy_header_three
之后

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

在virtualhost配置中:

SetEnvIfNoCase ^OAM.REMOTE.USER$ ^(.*)$ fix_accept_encoding=$1
RequestHeader set OAM-REMOTE-USER %{fix_accept_encoding}e env=fix_accept_encoding
如果您将mod_wsgi用于Django或Flask,则需要添加:


WSGIPassAuthorization On

这里有两个选项:

  • 编辑:


    我知道这并不能直接回答您从uu转换为的问题,但这是一个有助于缓解Apache 2.4与CA Siteminder标头问题的答案。

    您是否试图转换标头名称或标头值或两者?我想转换
    名称
    这只会将一个特定标头变量转换为小写,不是吗?
    # 
    # 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
    
    #its not explicitly stated but im assuming this should be in your WebAgent.conf file
    LegacyVariables="NO"