vavrecan / keeweb-local-server

Local Server Plugin for KeeWeb
23 stars 9 forks source link

Authorisation Header is not always available #11

Closed JodliDev closed 3 years ago

JodliDev commented 3 years ago

It took me some time to realise so I am adding it for others as well:

If php is configured over php-cgi, the Authorisation Header is stripped (and not available in $_SERVER) which will make theserver password-check in server.php impossible.

This can be easily solved by adding a .htaccess-file with the following content:

RewriteEngine On
RewriteCond %{HTTP:Authorization} ^(.+)$
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

More for example here: https://www.codepunker.com/blog/php-a-primer-on-the-basic-authorization-header

vavrecan commented 3 years ago

thank you, I updated readme file with these details as it might help some people