1

I have a client sending basic authentication credentials in a header named "Basic authentication", instead of the correct "Authorization". I can't fix the client, so I'm trying to work around the problem on the server.

This works and sets the "X-Authorization" header to whatever value was sent by the client in the "Basic authentication" header:

SetEnvIf ^Basic.authentication$ ^(.*)$ fixauth=$1
RequestHeader set X-Authorization %{fixauth}e env=fixauth

This sets the environment variable fixauth, but then RequestHeader does nothing:

SetEnvIf ^Basic.authentication$ ^(.*)$ fixauth=$1
RequestHeader set Authorization %{fixauth}e env=fixauth

Using "RequestHeader add" makes no difference. It looks as if mod_header would be refusing to touch the Authorization header, but there is nothing about it in the documentation and nothing that I could find in the source code.

What exactly is the problem? Why does setting X-Authorization work, but setting Authorization does not?

0 Answers0