Permalink
Browse files

[#302] Remove 'Content Type' and 'Content Length' on redirect (re-fix…

…ed.)
  • Loading branch information...
1 parent ee4ab2f commit 1d2e463432832cfe6c7f0555157283bf3d932f7b @assaf committed May 27, 2012
View
@@ -6,6 +6,8 @@ zombie.js-changelog(7) -- Changelog
Create DOM document after Web page has loaded.
+Remove 'Content Type' and 'Content Length' on redirect (re-fixed.)
+
## Version 1.1.6 2012-05-26
@@ -233,6 +233,12 @@ class Resources extends Array
body: content
else
body = (data || "").toString()
+ else
+ # In case of a redirect that switches to GET, make sure we don't send
+ # these headers.
+ delete headers["content-type"]
+ delete headers["content-length"]
+ delete headers["content-transfer-encoding"]
# We're going to use cookies later when recieving response.
cookies = browser.cookies(url.hostname, url.pathname)
Oops, something went wrong.
@@ -1,5 +1,4 @@
GET /connect/xd_arbiter.php?version=5
-host: s-static.ak.facebook.com
200 HTTP/1.1
content-type: text/html; charset=utf-8
@@ -23,4 +22,4 @@ __d("ua",[],function(a,b,c,d,e,f){var g=false,h,i,j,k,l,m,n,o,p,q;function r(){i
__d("copyProperties",[],function(a,b,c,d,e,f){function g(h,i){h=h||{};i=i||{};for(var j in i)h[j]=i[j];if(i.hasOwnProperty&&i.hasOwnProperty('toString')&&(typeof i.toString!='undefined')&&(h.toString!==i.toString))h.toString=i.toString;return h;}e.exports=g;});
__d("guid",[],function(a,b,c,d,e,f){function g(){return 'f'+(Math.random()*(1<<30)).toString(16).replace('.','');}e.exports=g;});
__d("DOMEventListener",[],function(a,b,c,d,e,f){var g,h;if(window.addEventListener){g=function(j,k,l){j.addEventListener(k,l,false);};h=function(j,k,l){j.removeEventListener(k,l,false);};}else if(window.attachEvent){g=function(j,k,l){j.attachEvent('on'+k,l);};h=function(j,k,l){j.detachEvent('on'+k,l);};}var i={add:function(j,k,l){g(j,k,l);return {remove:function(){h(j,k,l);j=null;}};},remove:h};e.exports=i;});
-require("initXdArbiter");</script></body></html>
+require("initXdArbiter");</script></body></html>
@@ -1,5 +1,4 @@
GET /rsrc.php/v1/y6/r/mJ0Qh2-fdEH.js
-host: s-static.ak.fbcdn.net
200 HTTP/1.1
access-control-allow-origin: *
@@ -95,4 +94,4 @@ __d("legacy:ServerJS",["ServerJS"],function(a,b,c,d){a.ServerJS=b('ServerJS');},
__d("SubmitOnEnterListener",["Bootloader","CSS"],function(a,b,c,d,e,f){var g=b('Bootloader'),h=b('CSS');document.documentElement.onkeydown=function(i){i=i||window.event;var j=i.target||i.srcElement,k=i.keyCode==13&&!i.altKey&&!i.ctrlKey&&!i.metaKey&&!i.shiftKey&&h.hasClass(j,'enter_submit');if(k){g.loadModules(['DOM','Input','trackReferrer','Form'],function(l,m,n,o){if(!m.isEmpty(j)){var p=j.form,q=l.scry(p,'.enter_submit_target')[0]||l.scry(p,'[type="submit"]')[0];if(q){var r=o.getAttribute(p,'ajaxify')||o.getAttribute(p,'action');if(r)n(p,r);q.click();}}});return false;}};});
__d("CommentPrelude",["CSS","Parent","userAction"],function(a,b,c,d,e,f){var g=b('CSS'),h=b('Parent'),i=b('userAction');function j(n,o){i('ufi',n,null,'FORCE');return k(n,o);}function k(n,o){var p=h.byTag(n,'form');l(p);var q=g.removeClass.curry(p,'hidden_add_comment');if(window.ScrollAwareDOM){window.ScrollAwareDOM.monitor(p,q);}else q();if(o!==false)(p.add_comment_text_text||p.add_comment_text).focus();return false;}function l(n){var o=g.removeClass.curry(n,'collapsed_comments');if(window.ScrollAwareDOM){window.ScrollAwareDOM.monitor(n,o);}else o();}var m={click:j,expand:k,uncollapse:l};e.exports=m;});
__d("legacy:ufi-comment-prelude-js",["CommentPrelude"],function(a,b,c,d){var e=b('CommentPrelude');a.fc_click=e.click;a.fc_expand=e.expand;a.fc_uncollapse=e.uncollapse;},3);
-void(0);
+void(0);
@@ -1,5 +1,4 @@
GET REGEXP /\/dialog\/oauth\?api_key/
-host: www.facebook.com
302 HTTP/1.1
cache-control: private, no-cache, no-store, must-revalidate
@@ -1,5 +1,4 @@
GET REGEXP /\/dialog\/oauth\?api_key=/
-host: www.facebook.com
302 HTTP/1.1
cache-control: private, no-cache, no-store, must-revalidate
@@ -1,5 +1,4 @@
GET REGEXP /\/login.php\?api_key=/
-host: www.facebook.com
200 HTTP/1.1
cache-control: private, no-cache, no-store, must-revalidate
@@ -1,6 +1,5 @@
POST REGEXP /\/login.php\?login_attempt=/
content-type: application/x-www-form-urlencoded
-host: www.facebook.com
302 HTTP/1.1
cache-control: private, no-cache, no-store, must-revalidate
@@ -1,6 +1,5 @@
POST /dialog/permissions.request
content-type: application/x-www-form-urlencoded
-host: www.facebook.com
200 HTTP/1.1
cache-control: private, no-cache, no-store, must-revalidate
@@ -1,6 +1,4 @@
GET REGEXP /\/dialog\/permissions.request\?_path=/
-content-type: application/x-www-form-urlencoded
-host: www.facebook.com
200 HTTP/1.1
cache-control: private, no-cache, no-store, must-revalidate

0 comments on commit 1d2e463

Please sign in to comment.