Merge branch 'master' of github.com:johnbintz/rack-livereload
This commit is contained in:
commit
141d5632ee
|
@ -54,7 +54,7 @@ module Rack
|
|||
|
||||
body.each do |line|
|
||||
if !headers['X-Rack-LiveReload'] && line['</head>']
|
||||
host_to_use = @options[:host] || env['HTTP_HOST'].gsub(%r{:.*}, '')
|
||||
host_to_use = (@options[:host] || env['HTTP_HOST'] || 'localhost').gsub(%r{:.*}, '')
|
||||
|
||||
if use_vendored?
|
||||
src = LIVERELOAD_JS_PATH.dup + "?host=#{host_to_use}"
|
||||
|
|
|
@ -124,6 +124,14 @@ describe Rack::LiveReload do
|
|||
body.should_not include('web_socket')
|
||||
end
|
||||
end
|
||||
|
||||
context 'no host at all' do
|
||||
let(:env) { {} }
|
||||
|
||||
it 'should use localhost' do
|
||||
body.should include('localhost')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context '/__rack/livereload.js' do
|
||||
|
|
Loading…
Reference in New Issue