We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e614064 + 4fedb31 commit 3d01dadCopy full SHA for 3d01dad
lib/guard/livereload/websocket.rb
@@ -12,6 +12,7 @@ def dispatch(data)
12
parser << data
13
# prepend with '.' to make request url usable as a file path
14
request_path = '.' + URI.parse(parser.request_url).path
15
+ request_path += '/index.html' if File.directory? request_path
16
if parser.http_method != 'GET' || parser.upgrade?
17
super #pass the request to websocket
18
elsif request_path == './livereload.js'
@@ -33,7 +34,8 @@ def _serve_file(path)
33
34
end
35
36
def _content_type(path)
- case File.extname(path)
37
+ case File.extname(path).downcase
38
+ when '.html', '.htm' then 'text/html'
39
when '.css' then 'text/css'
40
when '.js' then 'application/ecmascript'
41
when '.gif' then 'image/gif'
0 commit comments