lib/hippo/api/handlers/asset.rb in hippo-fw-0.9.7 vs lib/hippo/api/handlers/asset.rb in hippo-fw-0.9.8

- old
+ new

@@ -43,11 +43,10 @@ send_file(root.join(params['splat'].first).to_s) end end def self.asset_getter - root = Hippo::Extensions.controlling.root_path.join('public', 'assets') webpack = Hippo::API::Root.webpack if Hippo.env.production? lambda do file = webpack.file(params['asset'].to_sym, raise_on_not_found: false) if file @@ -59,10 +58,12 @@ else lambda do webpack.wait_until_available file = webpack.file(params['asset'].to_sym, raise_on_not_found: false) if file - redirect "http://#{env['SERVER_NAME']}:#{webpack.process.port}/assets/#{file}" + protocol = 'http' + protocol += 's' if Hippo::Webpack.using_ssl? + redirect "#{protocol}://#{env['SERVER_NAME']}:#{webpack.process.port}/assets/#{file}" else halt 404 end end end