Skip to content

Instantly share code, notes, and snippets.

@swdyh
Created May 11, 2013 08:52
Show Gist options
  • Save swdyh/5559352 to your computer and use it in GitHub Desktop.
Save swdyh/5559352 to your computer and use it in GitHub Desktop.
require 'sinatra'
get '/' do
<<-EOS
<html>
<head>
<script src="nosniff.js" /></script>
<link rel="stylesheet" href="nosniff.css" />
</head>
<body>nosniff test</body>
</html>
EOS
end
get '/nosniff.js' do
content_type 'text/plain'
headers 'X-Content-Type-Options' => 'nosniff'
'alert("js")'
end
get '/nosniff.css' do
content_type 'text/plain'
headers 'X-Content-Type-Options' => 'nosniff'
'body { background-color: red; }'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment