File tree 2 files changed +4
-4
lines changed
lib/react/server_rendering
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ def find_asset(logical_path)
27
27
asset_path = manifest . lookup ( logical_path ) . to_s
28
28
if asset_path . start_with? ( 'http' )
29
29
# Get a file from the webpack-dev-server
30
- dev_server_asset = open ( asset_path ) . read
30
+ dev_server_asset = URI . open ( asset_path ) . read
31
31
# Remove `webpack-dev-server/client/index.js` code which causes ExecJS to 💥
32
32
dev_server_asset . sub! ( CLIENT_REQUIRE , '//\0' )
33
33
dev_server_asset
@@ -44,7 +44,7 @@ def find_asset(logical_path)
44
44
ds = Webpacker . dev_server
45
45
# Remove the protocol and host from the asset path. Sometimes webpacker includes this, sometimes it does not
46
46
asset_path . slice! ( "#{ ds . protocol } ://#{ ds . host_with_port } " )
47
- dev_server_asset = open ( "#{ ds . protocol } ://#{ ds . host_with_port } #{ asset_path } " ) . read
47
+ dev_server_asset = URI . open ( "#{ ds . protocol } ://#{ ds . host_with_port } #{ asset_path } " ) . read
48
48
dev_server_asset . sub! ( CLIENT_REQUIRE , '//\0' )
49
49
dev_server_asset
50
50
else
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ def dev_server_running?
101
101
return false unless example_asset_path
102
102
return false unless example_asset_path . start_with? ( 'http://localhost:8080' )
103
103
begin
104
- file = open ( 'http://localhost:8080/packs/application.js' )
104
+ file = URI . open ( 'http://localhost:8080/packs/application.js' )
105
105
rescue StandardError => e
106
106
file = nil
107
107
end
@@ -134,7 +134,7 @@ def dev_server_running?
134
134
example_asset_path = manifest_data . values . first
135
135
return false unless example_asset_path
136
136
begin
137
- file = open ( "#{ ds . protocol } ://#{ ds . host } :#{ ds . port } #{ example_asset_path } " )
137
+ file = URI . open ( "#{ ds . protocol } ://#{ ds . host } :#{ ds . port } #{ example_asset_path } " )
138
138
rescue StandardError => e
139
139
file = nil
140
140
end
You can’t perform that action at this time.
0 commit comments