Skip to content

Instantly share code, notes, and snippets.

@nmeans
Created September 11, 2013 13:52
Show Gist options
  • Save nmeans/6523914 to your computer and use it in GitHub Desktop.
Save nmeans/6523914 to your computer and use it in GitHub Desktop.
A simple test of IE8 behavior re: history and POST -> GET redirect. IE does not write the '/DO_NOT_SHOW_IN_HISTORY' endpoint to history, and reloads '/' from cache when the back button is clicked. This is the desired behavior.
require 'rubygems'
require 'sinatra'
get '/' do
haml :form
end
post '/DO_NOT_SHOW_IN_HISTORY' do
redirect to('/show_in_history'), 302
end
get '/show_in_history' do
"<html>Success!</html>"
end
__END__
@@ form
%html
%form{action:"/DO_NOT_SHOW_IN_HISTORY", method:"POST"}
%button{type:"submit", name: "submit", text: "TEST"} Test!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment