Advertisement
wesleyac

Firefox Origin header

Jun 27th, 2014
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.84 KB | None | 0 0
  1. <html>
  2.     <head>
  3.         <title>Bug in firefox Origin header</title>
  4.         <script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
  5.     </head>
  6.     <body>
  7.         <script type="text/javascript">
  8.             $.extend(
  9.             {
  10.                 redirectPost: function(location, args)
  11.                 {
  12.                     var form = '';
  13.                     $.each( args, function( key, value ) {
  14.                         form += '<input type="hidden" name="'+key+'" value="'+value+'">';
  15.                     });
  16.                     $('<form action="' + location + '" method="POST">' + form + '</form>').appendTo($(document.body)).submit();
  17.                 }
  18.             });
  19.  
  20.             var redirect = 'https://example.com/postpage';
  21.             $.redirectPost(redirect, {somedata: "test"});
  22.         </script>
  23.     </body>
  24. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement