Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add content-type to make Rack::Lint happy and require openssl as depe…

…ndency.
  • Loading branch information...
commit 7baa7ec4d90efc58329ea0972379ce512d5d8a16 1 parent 81f2798
@robinator authored
Showing with 4 additions and 4 deletions.
  1. +2 −3 lib/rack-simple-auth.rb
  2. +2 −1  rack-simple-auth.gemspec
View
5 lib/rack-simple-auth.rb
@@ -1,5 +1,4 @@
-require 'rack'
-require 'rack/request'
+%w[ rubygems rack rack/request openssl ].each { |s| require s }
module Rack
class SimpleAuth
@@ -16,7 +15,7 @@ def call(env)
if authenticated? request.cookies
@app.call(env)
else
- [302, {'Location' => "#{@login_url}?return_to=#{request.url}"}, ['You must be logged in to see this.']]
+ [302, {'Content-Type' => 'text/plain', 'Location' => "#{@login_url}?return_to=#{request.url}"}, ['You must be logged in to see this.']]
end
end
View
3  rack-simple-auth.gemspec
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'rack-simple-auth'
- s.version = '0.0.1'
+ s.version = '0.0.2'
s.date = '2013-02-08'
s.summary = 'A rack middleware for cookie authentication.'
s.description = 'A middleware the prevents access to a rack app without the proper cookie.'
@@ -14,4 +14,5 @@ Gem::Specification.new do |s|
s.files = ['lib/rack-simple-auth.rb', 'README.md']
s.add_dependency 'rack'
+ s.add_dependency 'openssl'
end
Please sign in to comment.
Something went wrong with that request. Please try again.