unicorn-cuba-base 1.2.0 → 1.2.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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.0
1
+ 1.2.1
@@ -7,8 +7,13 @@ module URI
7
7
 
8
8
  # From http://en.wikipedia.org/wiki/Percent-encoding:
9
9
  # The generic URI syntax mandates that new URI schemes that provide for the representation of character data in a URI must, in effect, represent characters from the unreserved set without translation, and should convert all other characters to bytes according to UTF-8, and then percent-encode those values.
10
+ # Also sometimes JavaScript encode() function (deprecated) is being used; this uses %uXXXX encoding for UTF-8 chars
10
11
  def self.utf_decode(str)
11
- pct_decode(str).force_encoding('UTF-8').tap do |u|
12
+ pct_decode(str) # decode %XX bits
13
+ .force_encoding('UTF-8') # Make sure the string is interpreting UTF-8 chars
14
+ .gsub(/%u([0-9a-z]{4})/) {|s| [$1.to_i(16)].pack("U")} # Decode %uXXXX encoded chars (JavaScript.encode())
15
+ .tap do |u|
16
+ # Validate fins string
12
17
  raise URI::InvalidURIError, "invalid UTF-8 encoding in URI: #{u.inspect}" if not u.valid_encoding?
13
18
  end
14
19
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "unicorn-cuba-base"
8
- s.version = "1.2.0"
8
+ s.version = "1.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jakub Pastuszek"]
12
- s.date = "2014-07-28"
12
+ s.date = "2014-08-21"
13
13
  s.description = "web application base powered by Unicorn HTTP server and based on Cuba framework extended with additional Rack middleware and Cuba plugins"
14
14
  s.email = "jpastuszek@gmail.com"
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unicorn-cuba-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-28 00:00:00.000000000 Z
12
+ date: 2014-08-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cuba
@@ -223,7 +223,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
223
223
  version: '0'
224
224
  segments:
225
225
  - 0
226
- hash: 668318932229336882
226
+ hash: -870267465513696600
227
227
  required_rubygems_version: !ruby/object:Gem::Requirement
228
228
  none: false
229
229
  requirements: