rambulance 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +19 -8
- data/CHANGELOG.md +9 -1
- data/lib/rambulance/exceptions_app.rb +6 -0
- data/lib/rambulance/version.rb +1 -1
- data/test/fake_app/rails_app.rb +3 -0
- data/test/requests/error_json_test.rb +19 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17bc50582db6ee389d7b677e43fcea58bdc91c758fdc953b39fa2fae52d7ae6c
|
4
|
+
data.tar.gz: 1fdd148f730d07b03ce03f4722dd2c151d4291de58f515ed2084a347f66854d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4238686586fb7e22c95230a00d6e7fabf28312f43b018d750a0008590205a40b64413777f6a43559d26c045501f4e82cb7ef814204cb07ea9432a5f06f9c9606
|
7
|
+
data.tar.gz: a36d6333ec57c8706b3b5fb304362d0d1f1288b684009ee28842299bfb4daa015be58f93206eb146344d163d9e896166ce4dd4dc611af6d2e683124b742d30ab
|
data/.travis.yml
CHANGED
@@ -11,11 +11,12 @@ before_install:
|
|
11
11
|
|
12
12
|
rvm:
|
13
13
|
- 2.3.8
|
14
|
-
- 2.4.
|
15
|
-
- 2.5.
|
16
|
-
- 2.6.
|
14
|
+
- 2.4.10
|
15
|
+
- 2.5.8
|
16
|
+
- 2.6.6
|
17
|
+
- 2.7.1
|
17
18
|
- ruby-head
|
18
|
-
- jruby-9.2.
|
19
|
+
- jruby-9.2.11.1
|
19
20
|
- jruby-head
|
20
21
|
|
21
22
|
gemfile:
|
@@ -32,20 +33,30 @@ matrix:
|
|
32
33
|
gemfile: gemfiles/rails_60.gemfile
|
33
34
|
- rvm: 2.3.8
|
34
35
|
gemfile: gemfiles/rails_edge.gemfile
|
35
|
-
- rvm: 2.4.
|
36
|
+
- rvm: 2.4.10
|
36
37
|
gemfile: gemfiles/rails_60.gemfile
|
37
|
-
- rvm: 2.4.
|
38
|
+
- rvm: 2.4.10
|
38
39
|
gemfile: gemfiles/rails_edge.gemfile
|
39
|
-
- rvm: 2.6.
|
40
|
+
- rvm: 2.6.6
|
40
41
|
gemfile: gemfiles/rails_42.gemfile
|
42
|
+
- rvm: 2.7.1
|
43
|
+
gemfile: gemfiles/rails_42.gemfile
|
44
|
+
- rvm: 2.7.1
|
45
|
+
gemfile: gemfiles/rails_50.gemfile
|
46
|
+
- rvm: 2.7.1
|
47
|
+
gemfile: gemfiles/rails_51.gemfile
|
48
|
+
- rvm: 2.7.1
|
49
|
+
gemfile: gemfiles/rails_52.gemfile
|
41
50
|
- rvm: ruby-head
|
42
51
|
gemfile: gemfiles/rails_42.gemfile
|
43
52
|
- rvm: ruby-head
|
44
53
|
gemfile: gemfiles/rails_50.gemfile
|
45
54
|
- rvm: ruby-head
|
46
55
|
gemfile: gemfiles/rails_51.gemfile
|
56
|
+
- rvm: ruby-head
|
57
|
+
gemfile: gemfiles/rails_52.gemfile
|
47
58
|
allow_failures:
|
48
59
|
- rvm: ruby-head
|
49
|
-
- rvm: jruby-9.2.
|
60
|
+
- rvm: jruby-9.2.11.1
|
50
61
|
- rvm: jruby-head
|
51
62
|
- gemfile: gemfiles/rails_edge.gemfile
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## [v1.0.3](https://github.com/yuki24/rambulance/tree/v1.0.3)
|
2
|
+
|
3
|
+
_<sup>released at 2019-10-03 03:39:17 UTC</sup>_
|
4
|
+
|
5
|
+
#### Fixes
|
6
|
+
|
7
|
+
- Fixes a bug where custom exceptions app can not be loaded properly on Rails 6 and Zeitwerk ([#52](https://github.com/yuki24/rambulance/issues/52), [@sho918](https://github.com/sho918))
|
8
|
+
|
1
9
|
## [v1.0.2](https://github.com/yuki24/rambulance/tree/v1.0.2)
|
2
10
|
|
3
11
|
_<sup>released at 2019-06-06 23:39:38 UTC</sup>_
|
@@ -58,7 +66,7 @@ _<sup>released at 2018-01-02 21:36:02 UTC</sup>_
|
|
58
66
|
#### Breaking changes & deprecations
|
59
67
|
|
60
68
|
- Drop support for Ruby 1.9.3
|
61
|
-
- Drop support for
|
69
|
+
- Drop support for Haml and Slim templates
|
62
70
|
|
63
71
|
#### Bug fixes
|
64
72
|
|
@@ -67,6 +67,12 @@ module Rambulance
|
|
67
67
|
request.env["MALFORMED_BODY"], request.env["rack.input"] = request.env["rack.input"], StringIO.new
|
68
68
|
end
|
69
69
|
|
70
|
+
begin
|
71
|
+
request.accepts
|
72
|
+
rescue Mime::Type::InvalidMimeType
|
73
|
+
request.env["MALFORMED_HTTP_ACCEPT"], request.env["HTTP_ACCEPT"] = request.env["HTTP_ACCEPT"], "*/*"
|
74
|
+
end
|
75
|
+
|
70
76
|
# The #formats method needs to be called after the sanitization above.
|
71
77
|
request.formats << Mime::Type.lookup('text/plain')
|
72
78
|
|
data/lib/rambulance/version.rb
CHANGED
data/test/fake_app/rails_app.rb
CHANGED
@@ -8,6 +8,7 @@ class TestApp < Rails::Application
|
|
8
8
|
config.eager_load = false
|
9
9
|
config.root = File.dirname(__FILE__)
|
10
10
|
config.autoload_paths += ["#{config.root}/lib"] if ENV["CUSTOM_EXCEPTIONS_APP"]
|
11
|
+
config.hosts = "www.example.com"
|
11
12
|
|
12
13
|
if Rails::VERSION::STRING >= "5.2"
|
13
14
|
config.action_controller.default_protect_from_forgery = true
|
@@ -50,6 +51,7 @@ class ApplicationController < ActionController::Base
|
|
50
51
|
raise "This is a bad filter."
|
51
52
|
end
|
52
53
|
end
|
54
|
+
|
53
55
|
class UsersController < ApplicationController
|
54
56
|
if self.respond_to? :skip_before_action
|
55
57
|
skip_before_action :bad_filter, except: :show
|
@@ -79,6 +81,7 @@ class UsersController < ApplicationController
|
|
79
81
|
raise ForbiddenException
|
80
82
|
end
|
81
83
|
end
|
84
|
+
|
82
85
|
class ProjectsController < ApplicationController
|
83
86
|
if self.respond_to?(:skip_forgery_protection)
|
84
87
|
skip_forgery_protection
|
@@ -36,6 +36,25 @@ class ErrorJsonTest < ActionDispatch::IntegrationTest
|
|
36
36
|
assert_equal "Something went wrong", json_response['message']
|
37
37
|
end
|
38
38
|
|
39
|
+
test 'returns an appropriate status based on the rails version when the HTTP Accept header is malformed' do
|
40
|
+
if Rails::VERSION::STRING >= '5.1.0'
|
41
|
+
post '/users', headers: { "HTTP_ACCEPT" => "image/apng*/*" }
|
42
|
+
else
|
43
|
+
post '/users', nil, "HTTP_ACCEPT" => "image/apng*/*"
|
44
|
+
end
|
45
|
+
|
46
|
+
if Rails::VERSION::STRING >= '6.0.0'
|
47
|
+
assert_equal 406, response.status
|
48
|
+
assert_equal "The requested content type is not acceptable.\n", response.body
|
49
|
+
elsif Rails::VERSION::STRING >= '5.2.0'
|
50
|
+
assert_equal 422, response.status
|
51
|
+
elsif Rails::VERSION::STRING >= '5.1.0'
|
52
|
+
assert_equal 500, response.status
|
53
|
+
elsif Rails::VERSION::STRING >= '4.2.0'
|
54
|
+
assert_equal 201, response.status
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
39
58
|
private
|
40
59
|
|
41
60
|
def without_layouts
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rambulance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuki Nishijima
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -222,7 +222,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
222
222
|
- !ruby/object:Gem::Version
|
223
223
|
version: '0'
|
224
224
|
requirements: []
|
225
|
-
rubygems_version: 3.
|
225
|
+
rubygems_version: 3.1.3
|
226
226
|
signing_key:
|
227
227
|
specification_version: 4
|
228
228
|
summary: Simple and safe way to dynamically generate error pages
|