remove header from body msg
This commit is contained in:
parent
72967f25b9
commit
40a7ca0cdf
1 changed files with 9 additions and 2 deletions
|
@ -64,11 +64,18 @@ class FakeTunnelConnector
|
|||
|
||||
def write_response(tcp_socket, location)
|
||||
route_response_string = route_request(location)
|
||||
tcp_socket.sendmsg(ok(route_response_string))
|
||||
tcp_socket.print(ok_headers)
|
||||
tcp_socket.print(ok(route_response_string))
|
||||
end
|
||||
|
||||
def ok(body='Success')
|
||||
"HTTP/1.1 200 OK\r\nDate: #{Time.now.utc}\r\n\r\n#{body}\r\n"
|
||||
body + "\r"
|
||||
end
|
||||
|
||||
def ok_headers
|
||||
"HTTP/1.1 200 OK\r\n" +
|
||||
"Date: #{Time.now.utc}\r\n" +
|
||||
"\r\n"
|
||||
end
|
||||
|
||||
def route_request(location)
|
||||
|
|
Loading…
Add table
Reference in a new issue