Skip to content

Commit

Permalink
Integrate live.html into app.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansundin committed Oct 16, 2016
1 parent db894a5 commit 513f18f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app.rb
Expand Up @@ -8,6 +8,11 @@
erb :index
end

get "/live" do
SecureHeaders.use_secure_headers_override(request, :live)
send_file File.join(settings.public_folder, 'live.html')
end

get "/go" do
return "Insufficient parameters" if params[:q].empty?

Expand Down
16 changes: 16 additions & 0 deletions config/initializers/10-secure_headers.rb
Expand Up @@ -52,3 +52,19 @@
config.csp[:style_src] << "'unsafe-inline'"
end
end

# Live page
SecureHeaders::Configuration.override(:live) do |config|
config.csp.merge!({
# "meta" values. these will shape the header, but the values are not included in the header.
report_only: false,
preserve_schemes: true,
# directive values: these values will directly translate into source directives
default_src: %w('none'),
style_src: %w('self' *.bootstrapcdn.com),
script_src: %w('self' *.bootstrapcdn.com code.jquery.com cdn.rawgit.com),
font_src: %w(*.bootstrapcdn.com),
img_src: %w('self' graph.facebook.com scontent.xx.fbcdn.net i.ytimg.com static-cdn.jtvnw.net),
connect_src: %w(graph.facebook.com www.googleapis.com api.twitch.tv),
})
end
1 change: 1 addition & 0 deletions public/robots.txt
@@ -1,3 +1,4 @@
User-agent: *
Allow: /$
Allow: /live$
Disallow: /

0 comments on commit 513f18f

Please sign in to comment.