Created
October 7, 2017 06:18
-
-
Save nicklegr/b55035f9c7aaef4788c3fe3b308cadb4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def encode(str) | |
str | |
.gsub(" ", "%20") | |
.gsub("\n", "%0d%0a") | |
end | |
cmd = "curl gopher://example.com:80/_" + encode(<<-EOD) | |
GET / HTTP/1.1 | |
Host: example.com | |
EOD | |
puts cmd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment