Skip to content

Commit

Permalink
FIXME: change line to trigger HoundCi error
Browse files Browse the repository at this point in the history
  • Loading branch information
e2 committed Dec 8, 2014
1 parent ec5bd7e commit 523c178
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions lib/guard/livereload/websocket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@ def dispatch(data)

def _serve_file(path)
UI.debug "Serving file #{path}"
send_data "HTTP/1.1 200 OK\r\nContent-Type: #{_content_type(path)}\r\nContent-Length: #{File.size path}\r\n\r\n"

data = [
"HTTP/1.1 200 OK",
"Content-Type: %s",
"Content-Length: %s",
"",
""]
data = format(data * "\r\n", _content_type(path), File.size(path))
send_data(data)
stream_file_data(path).callback { close_connection_after_writing }
end

Expand All @@ -43,11 +51,10 @@ def _livereload_js_file
File.expand_path("../../../../js/livereload.js", __FILE__)
end

def _serve(request_path)
return _serve_file(_livereload_js_file) if request_path == "./livereload.js"
return _serve_file(request_path) if _readable_file(request_path)
send_data("HTTP/1.1 404 Not Found\r\nContent-Type: text/plain\r\nContent-Length: 13\r\n"\
"\r\n404 Not Found")
def _serve(path)
return _serve_file(_livereload_js_file) if path == "./livereload.js"
return _serve_file(path) if _readable_file(path)
send_data("HTTP/1.1 404 Not Found\r\nContent-Type: text/plain\r\nContent-Length: 13\r\n\r\n404 Not Found")
close_connection_after_writing
end

Expand Down

0 comments on commit 523c178

Please sign in to comment.