go_to_param 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 19bbfd139f7a3c04cae82b201603264929282a8d
4
- data.tar.gz: 664fd95648b290ccbdc9f5084d3ea6ed3ea54ee6
3
+ metadata.gz: 72eda2624e61954c9946f55d934d4901c1e96650
4
+ data.tar.gz: 32e6528195c767d629097d7d322c2e5e556dc2d2
5
5
  SHA512:
6
- metadata.gz: fa371354b00c217ee6fa0b43d3b8d1e6b91fc2e6d2e88ac85cb7044d95ed453e59bb9f6111926fd770b15dfc676cbb1cec8c50bcc3195caccc08de41a0e5d184
7
- data.tar.gz: 657fb095986d8300e54a473012fe7ff0f6d57f44255fb51c4fc18ac7e053341f216b9a26c5849739abc0903448544500aaa0323e37d8621b6592f60909ab9f85
6
+ metadata.gz: 98a305b56695de24207e93b4790a3f7a468e5a044ce319fc22004d0e72fda53d9e1e471d75414bb9d44259ef6aaf0da24d3fa523006746e1713e270bda0f76f9
7
+ data.tar.gz: 2c47057f2b829003393c1c8e0d11c529fbf4f825ef1b70f3799c8341aaeee23c22cf65d9ee15337f523b2c3c9ec6a143702ba60190f425696d1decfab8603c3a
@@ -0,0 +1,9 @@
1
+ # Changelog
2
+
3
+ ## 1.1.1
4
+
5
+ - Don't raise exceptions if given hash params from hack attempts, such as: `go_to[foo]=bar`.
6
+
7
+ ## Earlier
8
+
9
+ Sorry, no changelog available for earlier versions.
@@ -75,7 +75,9 @@ module GoToParam
75
75
  end
76
76
 
77
77
  def go_to_param_value
78
- params[:go_to]
78
+ # We use `to_s` to avoid "not a string" type errors from hack attempts where a hash is passed, e.g. "go_to[foo]=bar".
79
+ value = params[:go_to].to_s
80
+ value == "" ? nil : value
79
81
  end
80
82
 
81
83
  # Named this way to avoid conflicts. TODO: http://thepugautomatic.com/2014/02/private-api/
@@ -1,3 +1,3 @@
1
1
  module GoToParam
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -134,6 +134,11 @@ describe GoToParam do
134
134
  expect(controller.go_to_path).to be_nil
135
135
  end
136
136
 
137
+ it "is nil when given a hash" do
138
+ controller.params = { go_to: { evil: "true" }, id: "1" }
139
+ expect(controller.go_to_path).to be_nil
140
+ end
141
+
137
142
  it "respects custom allowed redirect prefixes" do
138
143
  GoToParam.allow_redirect_prefix("myapp://")
139
144
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: go_to_param
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henrik N
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-07 00:00:00.000000000 Z
11
+ date: 2017-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -60,6 +60,7 @@ extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
62
  - ".gitignore"
63
+ - CHANGELOG.md
63
64
  - Gemfile
64
65
  - README.md
65
66
  - Rakefile
@@ -87,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
88
  version: '0'
88
89
  requirements: []
89
90
  rubyforge_project:
90
- rubygems_version: 2.5.2
91
+ rubygems_version: 2.6.11
91
92
  signing_key:
92
93
  specification_version: 4
93
94
  summary: Rails "go_to" redirection param utilities.