sakaiproject/nakamura — pull request #949 by efroese (2012-08-01 18:20:45+00:00)
Title: NOJIRA trim values to nul before checking. Fix log message.

This came about as the result of a bit of httpd hackery.

mod_proxy_http doesn't send the REMOTE_USER header through to backend app servers.
I had to add a rewrite rule to add a new header that mod_proxy_http *would* pass along "Proxy-User".

RewriteEngine On
RewriteRule .* - [E=PROXY_USER:%{LA-U:REMOTE_USER}]
RequestHeader set Proxy-User %{PROXY_USER}e env=PROXY_USER

Cool right? Basically it says:
1. Look ahead in the request processing to find the REMOTE_USER variable.
2. Set the value of PROXY_USER to that value.
3. Set a header Proxy-User to the value of PROXY_USER if it exists in the environment.

Sometimes apache will send this through as an empty string, other times its null. The easiest thing to do was strip the value down to null before checking.