We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0680a51 + cbd9292 commit 6d57165Copy full SHA for 6d57165
core/main/router/router.rb
@@ -14,6 +14,19 @@ class Router < Sinatra::Base
14
15
configure do
16
set :show_exceptions, false
17
+
18
+ # Configure Rack::Protection::HostAuthorization.
19
+ # Allow Rack development defaults and dynamically permit the public host
20
+ # defined by beef.http.public.host to prevent "Host not permitted" errors.
21
+ permitted = [
22
+ '.localhost',
23
+ '.test',
24
+ IPAddr.new('0.0.0.0/0'),
25
+ IPAddr.new('::/0')
26
+ ]
27
+ public_host = config.get('beef.http.public.host').to_s.strip
28
+ permitted << public_host unless public_host.empty?
29
+ set :host_authorization, { permitted_hosts: permitted }
30
end
31
32
# @note Override default 404 HTTP response
0 commit comments