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

时间:2017-03-25 00:10:54

标签: apache2.4 siteminder

在项目中,必须运行CA Webagent Siteminder,它向我发送带有下划线的旧标头。由于Apache 2.4下划线被弃用并静默删除。

我需要通过total = float(input()) bill100 = int((total) / 100) total = ((total) - (bill100*100)) bill50 = int((total)/50) total = (total - (bill50*50)) bill20 = int(total/20) total = (total - (bill20*20)) bill10 = int(total/10) total = (total - (bill10*10)) bill5 = int(total/5) total = (total - (bill5*5)) bill2 = int(total/2) total = (total - (bill2*2)) coin1dolar = int(total) total = (total - coin1dolar) coin50 = int(total/0.50) total = (total - (coin50*0.50)) coin25 = int(total/0.25) total = (total - (coin25*0.25)) coin10 = int(total/0.10) total = (total - (coin10*0.10)) coin5 = int(total/0.05) total = (total - (coin5*0.05)) coin1cent = int(total/0.01) print("BILLS:") print(str(bill100) + " bills of R$ 100.00") print(str(bill50) + " bills of R$ 50.00") print(str(bill20) + " bills of R$ 20.00") print(str(bill10) + " bills of R$ 10.00") print(str(bill5) + " bills of R$ 5.00") print(str(bill2) + " bills of R$ 2.00") print("COINS:") print(str(coin1dolar) + " coins of R$ 1.00") print(str(coin50) + " coins of R$ 0.50") print(str(coin25) + " coins of R$ 0.25") print(str(coin10) + " coins of R$ 0.10") print(str(coin5) + " coins of R$ 0.05") print(str(coin1cent) + " coins of R$ 0.01") 解决方法,将所有下划线mod_headers转换为请求标头中的短划线_

之前

-

legacy_header_one
legacy_header_two
legacy_header_three

2 个答案:

答案 0 :(得分:0)

在虚拟主机配置中:

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

如果您对Django或Flask使用mod_wsgi,则需要添加:

WSGIPassAuthorization On

答案 1 :(得分:0)

这里有两个选项:

  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"
    
  3. 编辑:

    我知道这并没有直接回答你从_转换为 - 的问题,但这是帮助缓解Apache 2.4与CA Siteminder标题问题的答案。