rack-canonical-host 0.0.6 → 0.0.7

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.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## Rack::CanonicalHost 0.0.7
4
+
5
+ * Fix an issue handling URLs containing `|` characters
6
+
3
7
  ## Rack::CanonicalHost 0.0.6
4
8
 
5
9
  * Prevent redirect if the canonical host name is `nil`
data/README.md CHANGED
@@ -89,14 +89,28 @@ end
89
89
  ```
90
90
 
91
91
 
92
+ ## Contributing
93
+
94
+ 1. Fork it
95
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
96
+ 3. Commit your changes (`git commit -am 'Add some feature.'`)
97
+ 4. Push to the branch (`git push origin my-new-feature`)
98
+ 5. Create a new Pull Request
99
+
100
+
92
101
  ## Contributors
93
102
 
94
103
  Thanks to the following people who have contributed patches or helpful
95
104
  suggestions:
96
105
 
97
- * [Peter Baker](http://github.com/finack)
98
- * [Jon Wood](http://github.com/jellybob)
99
- * [Nathaniel Bibler](http://github.com/nbibler)
100
- * [Eric Allam](http://github.com/rubymaverick)
106
+ * [Peter Baker](https://github.com/finack)
107
+ * [Jon Wood](https://github.com/jellybob)
108
+ * [Nathaniel Bibler](https://github.com/nbibler)
109
+ * [Eric Allam](https://github.com/rubymaverick)
110
+ * [Fabrizio Regini](https://github.com/freegenie)
111
+
101
112
 
113
+ ## Copyright
102
114
 
115
+ Copyright © 2009-2012 Tyler Hunt.
116
+ Released under the terms of the MIT license. See LICENSE for details.
@@ -43,7 +43,7 @@ module Rack
43
43
  private :new_url
44
44
 
45
45
  def request_uri
46
- URI.parse(Rack::Request.new(@env).url)
46
+ URI.parse(Rack::Request.new(@env).url.gsub('|', '%7C'))
47
47
  end
48
48
  private :request_uri
49
49
  end
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class CanonicalHost
3
- VERSION = '0.0.6'
3
+ VERSION = '0.0.7'
4
4
  end
5
5
  end
@@ -58,6 +58,14 @@ describe Rack::CanonicalHost do
58
58
  let(:app) { build_app('example.com') }
59
59
 
60
60
  include_context 'matching and non-matching requests'
61
+
62
+ context 'when the request has a pipe in the URL' do
63
+ let(:url) { 'https://example.com/full/path?value=withPIPE' }
64
+
65
+ before { env['QUERY_STRING'].sub!('PIPE', '|') }
66
+
67
+ it { expect { subject }.to_not raise_error }
68
+ end
61
69
  end
62
70
 
63
71
  context 'with :ignore option' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-canonical-host
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: