diff --git a/lib/guard/livereload/websocket.rb b/lib/guard/livereload/websocket.rb index 0cca9b4..5a5a711 100644 --- a/lib/guard/livereload/websocket.rb +++ b/lib/guard/livereload/websocket.rb @@ -12,6 +12,7 @@ def dispatch(data) parser << data # prepend with '.' to make request url usable as a file path request_path = '.' + URI.parse(parser.request_url).path + request_path += '/index.html' if File.directory? request_path if parser.http_method != 'GET' || parser.upgrade? super #pass the request to websocket elsif request_path == './livereload.js' @@ -33,7 +34,8 @@ def _serve_file(path) end def _content_type(path) - case File.extname(path) + case File.extname(path).downcase + when '.html', '.htm' then 'text/html' when '.css' then 'text/css' when '.js' then 'application/ecmascript' when '.gif' then 'image/gif'