canonical-rails 0.0.5 → 0.0.6

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: c18700d23c45f68b450a9da262f88e7524a0388c
4
- data.tar.gz: 278eda8035516a953b73b54cac15c5a7428c0523
3
+ metadata.gz: f9d713cf1449219881ab8fabe93f81aa879503a6
4
+ data.tar.gz: 3afa9e60c076e347e668cb9818407e0d550982cc
5
5
  SHA512:
6
- metadata.gz: 054e6ed7f57e857cc5b7bd9b93756d937f46a819acabc13211fefb62216a040e830cc1ab4a80b2ccc2787f5dc7333492a44ef9441105f8ff405dfc9cb50fadc4
7
- data.tar.gz: 304915f4ed28c27353ad2dcde5ae5f06061c7c6189888cf27c95320eb305aa8c2395dfb3ad8da488f5dad9d839a8f4003283d97818be2ca3c7c20d7413d6a82f
6
+ metadata.gz: 621bacab738957f3db4107c504b19cc120f83684c03ad836fabd6b2d8a58fac2caa079226921a513d28cccf53ed5d84cee3535ec429d04c0b2488faedb3f0349
7
+ data.tar.gz: 0925ef6e2b063b1db45609694ef60a1ea9d8289f4c06aaf3ad776d100560eec6fa6ee66a27aed8e7e382a07c9c99c467f06e2e2025e5370a192717d0b675a339
@@ -18,11 +18,11 @@ module CanonicalRails
18
18
  end
19
19
 
20
20
  def canonical_href(host=canonical_host)
21
- "#{request.protocol}#{host}#{path_without_html_extension}#{trailing_slash_if_needed}#{whitelisted_query_string}"
21
+ raw "#{request.protocol}#{host}#{path_without_html_extension}#{trailing_slash_if_needed}#{whitelisted_query_string}"
22
22
  end
23
23
 
24
24
  def canonical_tag(host=canonical_host)
25
- tag(:link, :href => raw(canonical_href(host)), :rel => 'canonical')
25
+ tag(:link, :href => canonical_href(host), :rel => 'canonical')
26
26
  end
27
27
 
28
28
  def whitelisted_params
@@ -33,7 +33,7 @@ module CanonicalRails
33
33
  end
34
34
 
35
35
  def whitelisted_query_string
36
- "?#{whitelisted_params.map{ |key, val| "#{key}=#{val}" }.join('&')}" if whitelisted_params.present?
36
+ "?#{whitelisted_params.map{ |key, val| "#{CGI.escape(key)}=#{CGI.escape(val)}" }.join('&')}" if whitelisted_params.present?
37
37
  end
38
38
  end
39
39
  end
@@ -1,3 +1,3 @@
1
1
  module CanonicalRails
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canonical-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Ivanov