RequestHeader, SetEnvIf: Setting a missing RequestHeader

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

 

After googling and experimenting all morning, perhaps some kind soul would be willing to help.

 

We have a web service that is routed through an Apache 2.2 on Windows. A correct SOAP Request would be

 

POST http://myapache/cgi-bin/nph-owscgi.exe/olt_web/oltlogon HTTP/1.1

Accept-Encoding: gzip,deflate

Content-Type: text/xml;charset=UTF-8

SOAPAction: "http://127.0.0.1:5912"

               

<soapenv:Envelope …>

</soapenv:Envelope>

 

Note the SOAPAction RequestHeader. This tells the “nph-owscgi.exe” where to send the request so that the application server can process the request.

 

Some customers do not send us a SOAPHeader. In this case we would like to automatically set the SOAPHeader RequestHeader value.

 

Here an example of a Reqeust without a SOAPHeader:

 

POST http://myapache/cgi-bin/nph-owscgi.exe/olt_web/oltlogon HTTP/1.1

Accept-Encoding: gzip,deflate

Content-Type: text/xml;charset=UTF-8

SOAPAction: ""

               

<soapenv:Envelope …>

</soapenv:Envelope>

 

or

 

POST http://myapache/cgi-bin/nph-owscgi.exe/olt_web/oltlogon HTTP/1.1

Accept-Encoding: gzip,deflate

Content-Type: text/xml;charset=UTF-8

               

<soapenv:Envelope …>

</soapenv:Envelope>

 

Goal: to automatically set the SOAPAction if empty or missing.

 

Here what I would expect to work, but does not.

 

<Files "nph-owscgi.exe">

  SetEnvIf SOAPAction ^h.*$ HAVE_SOAPAction

  RequestHeader set SOAPAction "http://127.0.0.1:5912" env=!HAVE_SOAPAction

</Files>

 

What I am trying to tell Apache is, if the SOAPAction RequestHeader starts with an “h”, then set the environment variable HAVE_SOAPAction. If the environment variable HAVE_SOAPAction is not set, then set the SOAPAction ReqeustHeader to the default value of "http://127.0.0.1:5912".

 

Tried other

 

Unfortunately this is not working. The SOAPAction is always being overwritten, not just if empty or missing from the request headers.

 

Any tips what I am doing wrong?

 

Regards

 

Rudolf


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux