Skip to content

Commit

Permalink
Avoid blocking well-known URLs in the Apache config
Browse files Browse the repository at this point in the history
  • Loading branch information
stof authored and dzuelke committed Apr 12, 2023
1 parent 93ebb7d commit cf309bb
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### CHG

- Do not block access to /.well-known/ in Nginx config [Christophe Coevoet, David Zuelke]
- Do not block access to /.well-known/ in Apache HTTPD config [Christophe Coevoet, David Zuelke]

## v232 (2023-03-27)

Expand Down
2 changes: 1 addition & 1 deletion conf/apache2/heroku.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Listen ${PORT}
# lock it down fully by default
# if it's also the docroot, it'll be opened up again further below
Require all denied
<FilesMatch "^(\.|composer\.(json|lock|phar)$|Procfile$)">
<FilesMatch "^(\.(?!well-known\/)|composer\.(json|lock|phar)$|Procfile$)">
# explicitly deny these again, merged with the docroot later
Require all denied
</FilesMatch>
Expand Down
20 changes: 20 additions & 0 deletions test/spec/httpd_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
require_relative "spec_helper"

describe "A PHP application" do
it "allows access to /.well-known/ with Apache HTTPD" do
new_app_with_stack_and_platrepo('test/fixtures/default').tap do |app|
app.before_deploy(:append) do
FileUtils.mkdir_p(".well-known/acme")
File.open(".well-known/acme/foo", "w+") do |f|
f.write 'bar'
end
File.open("Procfile", "w+") do |f|
f.write 'web: heroku-php-apache2'
end
end
app.deploy do |app|
expect(successful_body(app, path: '/.well-known/acme/foo')).to eq 'bar'
end
end
end
end
1 change: 1 addition & 0 deletions test/var/log/parallel_runtime_rspec.heroku-18.log
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ test/spec/blackfire_spec.rb:239.20765019800092
test/spec/bugs_spec.rb:45.368704143
test/spec/ci_spec.rb:274.321140925
test/spec/composer_spec.rb:90.616864848999995
test/spec/httpd_spec.rb:18.68997263999998
test/spec/newrelic_spec.rb:86.77255344099999
test/spec/nginx_spec.rb:49.700997473
test/spec/php_7.1-apache2_boot_spec.rb:129.810977812
Expand Down
1 change: 1 addition & 0 deletions test/var/log/parallel_runtime_rspec.heroku-20.log
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ test/spec/blackfire_spec.rb:239.20765019800092
test/spec/bugs_spec.rb:30.021669688999992
test/spec/ci_spec.rb:274.321140925
test/spec/composer_spec.rb:90.616864848999995
test/spec/httpd_spec.rb:18.68997263999998
test/spec/newrelic_spec.rb:86.77255344099999
test/spec/nginx_spec.rb:49.700997473
test/spec/php_7.3-apache2_boot_spec.rb:135.224324281
Expand Down
1 change: 1 addition & 0 deletions test/var/log/parallel_runtime_rspec.heroku-22.log
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ test/spec/blackfire_spec.rb:239.20765019800092
test/spec/bugs_spec.rb:30.021669688999992
test/spec/ci_spec.rb:274.321140925
test/spec/composer_spec.rb:90.616864848999995
test/spec/httpd_spec.rb:18.68997263999998
test/spec/newrelic_spec.rb:86.77255344099999
test/spec/nginx_spec.rb:49.700997473
test/spec/php_8.1-apache2_boot_spec.rb:160.79852702099998
Expand Down

0 comments on commit cf309bb

Please sign in to comment.