Created
October 17, 2022 21:21
-
-
Save postmodern/924538f4333fba16588cde44cec52083 to your computer and use it in GitHub Desktop.
Testing infinite responses with HEAD requests
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'bundler/setup' | |
require 'sinatra/base' | |
class App < Sinatra::Base | |
get '/' do | |
[200, {}, ('A'..)] | |
end | |
end | |
App.run!(server: ARGV[0] || 'webrick') |
This file contains hidden or 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
source 'https://rubygems.org/' | |
gem 'sinatra', '~> 2.0' | |
gem 'webrick' | |
gem 'thin' | |
gem 'puma' | |
gem 'unicorn' |
This file contains hidden or 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
$ ./app.rb | |
$ curl --head http://localhost:4567/ | |
HTTP/1.1 200 OK | |
Content-Type: text/html;charset=utf-8 | |
X-Xss-Protection: 1; mode=block | |
X-Content-Type-Options: nosniff | |
X-Frame-Options: SAMEORIGIN | |
Server: WEBrick/1.7.0 (Ruby/3.1.2/2022-04-12) | |
Date: Mon, 17 Oct 2022 21:20:32 GMT | |
Content-Length: 0 | |
Connection: Keep-Alive | |
$ ./app.rb thin | |
$ curl --head http://localhost:4567/ | |
HTTP/1.1 200 OK | |
Content-Type: text/html;charset=utf-8 | |
X-XSS-Protection: 1; mode=block | |
X-Content-Type-Options: nosniff | |
X-Frame-Options: SAMEORIGIN | |
Connection: close | |
Server: thin | |
$ ./app puma | |
Content-Type: text/html;charset=utf-8 | |
X-XSS-Protection: 1; mode=block | |
X-Content-Type-Options: nosniff | |
X-Frame-Options: SAMEORIGIN | |
Content-Length: 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment