diff options
author | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2019-08-27 20:58:44 -0700 |
---|---|---|
committer | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2019-08-27 20:58:44 -0700 |
commit | bd41113ec0a6a64bf0c41c130ad95fdc239767c4 (patch) | |
tree | 15ad36743fcf88fcba2308da751154256d9027cc | |
parent | f9aeca796df3acf09feb773c257f29f056ef3f1b (diff) |
Detect non-curl user agents
-rw-r--r-- | curling.rb | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -9,6 +9,19 @@ end before do headers 'Content-Type' => 'text/plain' + if request.user_agent !~ /^curl/ + halt <<~MSG +Welcome to Hex Curler! +====================== +This game is based on Jeff Moore's Hex (www.1km1kt.net/rpg/hex). +Source code: gitlab.com/m-chrzan/hex-curler + +This game is meant to be experienced in the command line. Run the following line +of bash to get started: + +c=; while clear; curl -c k -b k hex.m-chrzan.xyz/$c; read c; [ $c ]; do :; done + MSG + end end get '/' do |