heroku_standard_config 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b25a32f391c962d834696654bf898944bacdd4b0
4
+ data.tar.gz: 2154da31ab01300bad85483dbe46e26910c52360
5
+ SHA512:
6
+ metadata.gz: 96b47ac381adb30981efd41550d406c10c410fc0deb8f14d8d87593e20244b4e33832374dda0064f05eae3aff8279eb6122347444f235627d976698f5b185030
7
+ data.tar.gz: 288cc351ca6d225784b7898789fc03af09a01ba02afbfcb18e47eb59d513c567cbed9ca295504bbdae68ed2338ae5d5a6d313966217d6dabb45af4dd4f19e087
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # HerokuStandardConfig
2
2
 
3
- Release: [![Build Status](https://travis-ci.org/heroku/heroku_standard_config.png?branch=v0.0.1)](https://travis-ci.org/heroku/heroku_standard_config)
3
+ Release: [![Build Status](https://travis-ci.org/heroku/heroku_standard_config.png?branch=v0.0.2)](https://travis-ci.org/heroku/heroku_standard_config)
4
4
  Master: [![Build Status](https://travis-ci.org/heroku/heroku_standard_config.png?branch=master)](https://travis-ci.org/heroku/heroku_standard_config)
5
5
  Development: [![Build Status](https://travis-ci.org/heroku/heroku_standard_config.png?branch=development)](https://travis-ci.org/heroku/heroku_standard_config)
6
6
 
@@ -5,7 +5,7 @@ module HerokuStandardConfig
5
5
  class Railtie < Rails::Railtie
6
6
  initializer "heroku_standard_config.insert_middleware" do |app|
7
7
  app.middleware.insert_before(Rack::Lock, Rack::Rewrite) do
8
- r301 %r{^/(.*)/(\?.*)?$}, '/$1$2'
8
+ r301 %r{^/([^/]*)/(\?.*)?$}, '/$1$2'
9
9
  end
10
10
 
11
11
  app.middleware.use Rack::Protection::FrameOptions
@@ -0,0 +1,14 @@
1
+ require 'rack/protection'
2
+ require 'rack/rewrite'
3
+
4
+ module HerokuStandardConfig
5
+ class Railtie < Rails::Railtie
6
+ initializer "heroku_standard_config.insert_middleware" do |app|
7
+ app.middleware.insert_before(Rack::Lock, Rack::Rewrite) do
8
+ r301 %r{^/(.*)/(\?.*)?$}, '/$1$2'
9
+ end
10
+
11
+ app.middleware.use Rack::Protection::FrameOptions
12
+ end
13
+ end
14
+ end
@@ -1,3 +1,3 @@
1
1
  module HerokuStandardConfig
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -0,0 +1,3 @@
1
+ module HerokuStandardConfig
2
+ VERSION = "0.0.2"
3
+ end
@@ -0,0 +1,5 @@
1
+ # Load the rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application.
5
+ Dummy::Application.initialize!
@@ -0,0 +1,2 @@
1
+ require 'rack/handler'
2
+ Rack::Handler::WEBrick = Rack::Handler::Unicorn
@@ -1,13 +1,8 @@
1
- Connecting to database specified by database.yml
2
- Connecting to database specified by database.yml
3
- Processing by DummyController#index as HTML
4
- Rendered text template (0.0ms)
5
- Completed 200 OK in 23.0ms (Views: 22.8ms)
6
- Started GET "/dummy/" for 127.0.0.1 at 2013-10-22 13:27:44 -0700
7
- Started GET "/dummy/?foo=bar" for 127.0.0.1 at 2013-10-22 13:27:44 -0700
8
- Started GET "/dummy/" for 127.0.0.1 at 2013-10-22 13:27:56 -0700
9
- Started GET "/dummy/?foo=bar" for 127.0.0.1 at 2013-10-22 13:27:56 -0700
10
- Started GET "/dummy/" for 127.0.0.1 at 2013-10-22 13:28:25 -0700
11
- Started GET "/dummy/?foo=bar" for 127.0.0.1 at 2013-10-22 13:28:25 -0700
12
- Started GET "/dummy/" for 127.0.0.1 at 2013-10-22 13:29:27 -0700
13
- Started GET "/dummy/?foo=bar" for 127.0.0.1 at 2013-10-22 13:29:27 -0700
1
+ Started GET "/" for 127.0.0.1 at 2014-08-05 11:18:24 -0700
2
+ Started GET "/" for 127.0.0.1 at 2014-08-05 11:19:32 -0700
3
+ Started GET "/dummy/www.evil.com/" for 127.0.0.1 at 2014-08-05 14:53:21 -0700
4
+ Started GET "/dummy/www.evil.com/" for 127.0.0.1 at 2014-08-05 14:55:03 -0700
5
+ Started GET "/dummy/www.evil.com/" for 127.0.0.1 at 2014-08-05 14:56:12 -0700
6
+ Started GET "/dummy/www.evil.com/" for 127.0.0.1 at 2014-08-05 14:57:12 -0700
7
+ Started GET "/dummy/www.evil.com/" for 127.0.0.1 at 2014-08-05 14:57:47 -0700
8
+ Started GET "/dummy/www.evil.com/" for 127.0.0.1 at 2014-08-05 14:58:45 -0700
@@ -10,4 +10,8 @@ class RedirectTest < ActionDispatch::IntegrationTest
10
10
  get '/dummy/?foo=bar'
11
11
  assert_redirected_to '/dummy?foo=bar'
12
12
  end
13
+
14
+ test "it does not redirect with multiple slashes" do
15
+ assert_raises(ActionController::RoutingError) { get '/dummy///www.evil.com/' }
16
+ end
13
17
  end
@@ -0,0 +1,17 @@
1
+ require 'test_helper'
2
+
3
+ class RedirectTest < ActionDispatch::IntegrationTest
4
+ test "redirect and remove trailing slash" do
5
+ get '/dummy/'
6
+ assert_redirected_to '/dummy'
7
+ end
8
+
9
+ test "redirect and remove trailing slash while retaining query params" do
10
+ get '/dummy/?foo=bar'
11
+ assert_redirected_to '/dummy?foo=bar'
12
+ end
13
+
14
+ test "it squashes multiple slashes" do
15
+ assert_raises(ActionController::RoutingError) { get '/dummy///www.evil.com/' }
16
+ end
17
+ end
@@ -0,0 +1,10 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require 'unicorn_rails'
5
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
6
+
7
+ Rails.backtrace_cleaner.remove_silencers!
8
+
9
+ # Load support files
10
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
metadata CHANGED
@@ -1,62 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heroku_standard_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
5
- prerelease:
4
+ version: 0.0.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Jonathan Clem
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-10-23 00:00:00.000000000 Z
11
+ date: 2014-08-05 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rails
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
19
  version: 3.2.0
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
26
  version: 3.2.0
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rack-rewrite
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rack-protection
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  description: Common configuration for some Heroku Rails apps, including redirects
@@ -67,12 +60,16 @@ executables: []
67
60
  extensions: []
68
61
  extra_rdoc_files: []
69
62
  files:
70
- - lib/heroku_standard_config/version.rb
71
- - lib/heroku_standard_config.rb
72
- - lib/tasks/heroku_standard_config_tasks.rake
73
63
  - MIT-LICENSE
74
- - Rakefile
75
64
  - README.md
65
+ - Rakefile
66
+ - lib/heroku_standard_config.rb
67
+ - lib/heroku_standard_config.rb~
68
+ - lib/heroku_standard_config/version.rb
69
+ - lib/heroku_standard_config/version.rb~
70
+ - lib/tasks/heroku_standard_config_tasks.rake
71
+ - test/dummy/README.rdoc
72
+ - test/dummy/Rakefile
76
73
  - test/dummy/app/assets/javascripts/application.js
77
74
  - test/dummy/app/assets/stylesheets/application.css
78
75
  - test/dummy/app/controllers/application_controller.rb
@@ -81,9 +78,11 @@ files:
81
78
  - test/dummy/bin/bundle
82
79
  - test/dummy/bin/rails
83
80
  - test/dummy/bin/rake
81
+ - test/dummy/config.ru
84
82
  - test/dummy/config/application.rb
85
83
  - test/dummy/config/boot.rb
86
84
  - test/dummy/config/environment.rb
85
+ - test/dummy/config/environment.rb~
87
86
  - test/dummy/config/environments/development.rb
88
87
  - test/dummy/config/environments/production.rb
89
88
  - test/dummy/config/environments/test.rb
@@ -93,51 +92,43 @@ files:
93
92
  - test/dummy/config/initializers/mime_types.rb
94
93
  - test/dummy/config/initializers/secret_token.rb
95
94
  - test/dummy/config/initializers/session_store.rb
95
+ - test/dummy/config/initializers/unicorn.rb~
96
96
  - test/dummy/config/initializers/wrap_parameters.rb
97
97
  - test/dummy/config/locales/en.yml
98
98
  - test/dummy/config/routes.rb
99
- - test/dummy/config.ru
100
- - test/dummy/log/development.log
101
99
  - test/dummy/log/test.log
102
100
  - test/dummy/public/404.html
103
101
  - test/dummy/public/422.html
104
102
  - test/dummy/public/500.html
105
103
  - test/dummy/public/favicon.ico
106
- - test/dummy/Rakefile
107
- - test/dummy/README.rdoc
108
104
  - test/frame_options_test.rb
109
105
  - test/heroku_standard_config_test.rb
110
106
  - test/rack_rewrite_test.rb
107
+ - test/rack_rewrite_test.rb~
111
108
  - test/test_helper.rb
109
+ - test/test_helper.rb~
112
110
  homepage: https://github.com/heroku/heroku_standard_config
113
111
  licenses: []
112
+ metadata: {}
114
113
  post_install_message:
115
114
  rdoc_options: []
116
115
  require_paths:
117
116
  - lib
118
117
  required_ruby_version: !ruby/object:Gem::Requirement
119
- none: false
120
118
  requirements:
121
- - - ! '>='
119
+ - - ">="
122
120
  - !ruby/object:Gem::Version
123
121
  version: '0'
124
- segments:
125
- - 0
126
- hash: 3802017961314430887
127
122
  required_rubygems_version: !ruby/object:Gem::Requirement
128
- none: false
129
123
  requirements:
130
- - - ! '>='
124
+ - - ">="
131
125
  - !ruby/object:Gem::Version
132
126
  version: '0'
133
- segments:
134
- - 0
135
- hash: 3802017961314430887
136
127
  requirements: []
137
128
  rubyforge_project:
138
- rubygems_version: 1.8.23
129
+ rubygems_version: 2.2.2
139
130
  signing_key:
140
- specification_version: 3
131
+ specification_version: 4
141
132
  summary: Common configuration for some Heroku Rails apps.
142
133
  test_files:
143
134
  - test/dummy/app/assets/javascripts/application.js
@@ -151,6 +142,7 @@ test_files:
151
142
  - test/dummy/config/application.rb
152
143
  - test/dummy/config/boot.rb
153
144
  - test/dummy/config/environment.rb
145
+ - test/dummy/config/environment.rb~
154
146
  - test/dummy/config/environments/development.rb
155
147
  - test/dummy/config/environments/production.rb
156
148
  - test/dummy/config/environments/test.rb
@@ -160,11 +152,11 @@ test_files:
160
152
  - test/dummy/config/initializers/mime_types.rb
161
153
  - test/dummy/config/initializers/secret_token.rb
162
154
  - test/dummy/config/initializers/session_store.rb
155
+ - test/dummy/config/initializers/unicorn.rb~
163
156
  - test/dummy/config/initializers/wrap_parameters.rb
164
157
  - test/dummy/config/locales/en.yml
165
158
  - test/dummy/config/routes.rb
166
159
  - test/dummy/config.ru
167
- - test/dummy/log/development.log
168
160
  - test/dummy/log/test.log
169
161
  - test/dummy/public/404.html
170
162
  - test/dummy/public/422.html
@@ -175,4 +167,6 @@ test_files:
175
167
  - test/frame_options_test.rb
176
168
  - test/heroku_standard_config_test.rb
177
169
  - test/rack_rewrite_test.rb
170
+ - test/rack_rewrite_test.rb~
178
171
  - test/test_helper.rb
172
+ - test/test_helper.rb~
File without changes