18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/http_handler.rb', line 18
def process_http_request
begin
@config.reload
resp = EventMachine::DelegatedHttpResponse.new( self )
if @http_request_method == "GET"
req = RequestHandler.new({:config => @config, :log => @log, :method => @http_request_method, :path => @http_path_info, :query => @http_query_string, :body => @http_post_content})
req.run
resp.status = req.status
resp.content = req.message
resp.send_response
else
req = RequestHandler.new({:config => @config, :log => @log, :method => @http_request_method, :path => @http_path_info, :query => @http_query_string, :body => @http_post_content})
req.run
resp.content = "Deploy queued"
resp.send_response
end
rescue Exception => e
send(resp, 500, "Error while processing HTTP request: #{e.inspect} \nREQUEST: #{@http_request_method} #{@http_path_info}?#{@http_query_string}\n#{@http_post_content}")
@log.error "Backtrace: #{e.backtrace}"
end
end
|