Skip to content

Instantly share code, notes, and snippets.

@havenwood
Created March 25, 2020 15:24
Show Gist options
  • Save havenwood/bc31dfe1bc8d6a46b49295506fe69578 to your computer and use it in GitHub Desktop.
Save havenwood/bc31dfe1bc8d6a46b49295506fe69578 to your computer and use it in GitHub Desktop.
def forge_app response_code
Proc.new do
[response_code.to_s, {'Content-Type' => 'text/html; charset=utf-8'}, [@content, "<script>console.log('Hello, World.')</script>"]]
end
end
status, headers, body = forge_app(200).call
headers
#=> {"Content-Type"=>"text/html; charset=utf-8"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment