Skip to content

Instantly share code, notes, and snippets.

@pete
Created October 5, 2011 03:10
Show Gist options
  • Save pete/1263527 to your computer and use it in GitHub Desktop.
Save pete/1263527 to your computer and use it in GitHub Desktop.
The "/" has to be there before rack even gets to it; you cant do a GET without a path of some sort.
pete@aku:~$ echo -ne 'GET / HTTP/1.0\r\n\r\n' | netcat localhost 80
HTTP/1.0 200 OK
[elided]
pete@aku:~$ echo -ne 'GET HTTP/1.0\r\n\r\n' | netcat localhost 80
HTTP/1.0 400 Bad Request
Content-Type: text/html
Content-Length: 349
Connection: close
Date: Wed, 05 Oct 2011 03:05:54 GMT
Server: lighttpd/1.4.28
[elided]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment