Permalink
Browse files

Remove X-Frame-Options to allow embedding Hacker Says into iframe.

Use Sinatra::Reloader in development.
  • Loading branch information...
jarmo committed May 23, 2012
1 parent 74ec8db commit b30aec0fd58d48043440c8d94f47999d094ddf14
Showing with 22 additions and 0 deletions.
  1. +4 −0 Gemfile
  2. +11 −0 Gemfile.lock
  3. +7 −0 hackersays.rb
View
@@ -7,3 +7,7 @@ gem "haml"
gem "sass"
gem "compass"
gem "yajl-ruby"
+
+group :development do
+ gem "sinatra-contrib"
+end
View
@@ -1,6 +1,7 @@
GEM
remote: http://rubygems.org/
specs:
+ backports (2.3.0)
chunky_png (1.2.5)
compass (0.12.1)
chunky_png (~> 1.2)
@@ -14,11 +15,20 @@ GEM
rack (1.4.1)
rack-protection (1.2.0)
rack
+ rack-test (0.6.1)
+ rack (>= 1.0)
sass (3.1.17)
sinatra (1.3.2)
rack (~> 1.3, >= 1.3.6)
rack-protection (~> 1.2)
tilt (~> 1.3, >= 1.3.3)
+ sinatra-contrib (1.3.1)
+ backports (>= 2.0)
+ eventmachine
+ rack-protection
+ rack-test
+ sinatra (~> 1.3.0)
+ tilt (~> 1.3)
thin (1.3.1)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
@@ -37,5 +47,6 @@ DEPENDENCIES
haml
sass
sinatra
+ sinatra-contrib
thin
yajl-ruby
View
@@ -20,9 +20,16 @@ class HackerSays < Sinatra::Base
set :haml, {:format => :html5}
set :scss, Compass.sass_engine_options.
merge(:views => File.join(public_folder, "themes"))
+ set :protection, :except => :frame_options
+
use WwwMiddleware
end
+ configure :development do
+ require "sinatra/reloader"
+ register Sinatra::Reloader
+ end
+
def quotes
return @quotes if production? && defined? @quotes

0 comments on commit b30aec0

Please sign in to comment.