Last active
January 13, 2016 06:21
-
-
Save negima1976/60da82065634419168c2 to your computer and use it in GitHub Desktop.
Deny a connection other than the specific request method.
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
lambda do |env| | |
if /^(GET|POST|HEAD)/.match(env(["REQUEST_METHOD"])) | |
return [200, {},[]] | |
end | |
[405, {'content-type' => 'text/plain'}, ["Method Not Allowed\n"]] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
h2o Mruby Directives