8000 minor #34460 Simpler example for Apache basic auth workaround (Roy-Or… · symfony/symfony@46eefa9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 46eefa9

Browse files
minor #34460 Simpler example for Apache basic auth workaround (Roy-Orbison)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead. Discussion ---------- Simpler example for Apache basic auth workaround Uses a simpler regex and existing back-reference instead of reading header twice. | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | #1813 | License | MIT Improvement to code documentation, no change to executed code. Commits ------- 388528d Simpler example for Apache basic auth workaround
2 parents e23fd9e + 388528d commit 46eefa9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Symfony/Component/HttpFoundation/ServerBag.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ public function getHeaders()
4646
/*
4747
* php-cgi under Apache does not pass HTTP Basic user/pass to PHP by default
4848
* For this workaround to work, add these lines to your .htaccess file:
49-
* RewriteCond %{HTTP:Authorization} ^(.+)$
50-
* RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
49+
* RewriteCond %{HTTP:Authorization} .+
50+
* RewriteRule ^ - [E=HTTP_AUTHORIZATION:%0]
5151
*
5252
* A sample .htaccess file:
5353
* RewriteEngine On
54-
* RewriteCond %{HTTP:Authorization} ^(.+)$
55-
* RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
54+
* RewriteCond %{HTTP:Authorization} .+
55+
* RewriteRule ^ - [E=HTTP_AUTHORIZATION:%0]
5656
* RewriteCond %{REQUEST_FILENAME} !-f
5757
* RewriteRule ^(.*)$ app.php [QSA,L]
5858
*/

0 commit comments

Comments
 (0)
0