Skip to content

Commit 638e86c

Browse files
committed
Merge pull request #405 from InnovativeTravel/replace_uri_parse_with_addressable
Replace URI parse with Addressable gem
2 parents 9995619 + a4d95eb commit 638e86c

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ All notable changes to this project will be documented in this file. Items under
33

44
Contributors: please follow the recommendations outlined at [keepachangelog.com](http://keepachangelog.com/). Please use the existing headings and styling as a guide, and add a link for the version diff at the bottom of the file. Also, please update the `Unreleased` link to compare to the latest release version.
55
## [Unreleased]
6+
##### Changed
7+
- Replace URI with Addressable gem. See [#405](https://github.com/shakacode/react_on_rails/pull/405) by [lucke84]
68

79
## [5.2.0] - 2016-04-08
810
##### Added

app/helpers/react_on_rails_helper.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,10 @@ def initialize_redux_stores
338338
# second parameter passed to both component and store generator functions.
339339
def rails_context(server_side:)
340340
@rails_context ||= begin
341-
uri = URI.parse(request.original_url)
342-
# uri = URI("http://foo.com:3000/posts?id=30&limit=5#time=1305298413")
341+
# Using Addressable instead of standard URI to better deal with
342+
# non-ASCII characters (see https://github.com/shakacode/react_on_rails/pull/405)
343+
uri = Addressable::URI.parse(request.original_url)
344+
# uri = Addressable::URI.parse("http://foo.com:3000/posts?id=30&limit=5#time=1305298413")
343345

344346
result = {
345347
# URL settings

react_on_rails.gemspec

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Gem::Specification.new do |s|
2424
s.add_dependency "rainbow", "~> 2.1"
2525
s.add_dependency "rails", ">= 3.2"
2626
s.add_dependency "foreman"
27+
s.add_dependency "addressable"
2728

2829
s.add_development_dependency "bundler", "~> 1.10"
2930
s.add_development_dependency "rake", "~> 10.0"

spec/dummy/Gemfile.lock

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ PATH
22
remote: ../..
33
specs:
44
react_on_rails (5.2.0)
5+
addressable
56
connection_pool
67
execjs (~> 2.5)
78
foreman
@@ -97,7 +98,7 @@ GEM
9798
erubis (2.7.0)
9899
execjs (2.6.0)
99100
ffi (1.9.10)
100-
foreman (0.78.0)
101+
foreman (0.81.0)
101102
thor (~> 0.19.1)
102103
generator_spec (0.9.3)
103104
activesupport (>= 3.0.0)

0 commit comments

Comments
 (0)