PHP Redirect, Iptables, and data after connection closed -


this odd one. found 3-month old bug in our code post 302 redirect header after print_r. result, browser receive string, , not redirect next page.

this print_r had been in production exceptionally long period of time , no 1 has mentioned it, led believe config difference on production , development. latest change change iptables, , when reverted change, seemed fix issue.

oddly, can not reproduce issue our own edification. brings me question, can iptables affect 302 redirect? less, care if data sent before headers? research, no, wanted ping all-knowing ones first.

the person made iptables change few days ago (which reverted , somehow solved issue) says these offending entrys:

accept -- 0.0.0.0/0 0.0.0.0/0  accept -- 0.0.0.0/0 0.0.0.0/0 state related,established 

the first entry has been, , second entry changed broke site. reverting first entry 'fixed it.' first, know, super secure...it's local dev box.

i tried curling url (that working, because can't break it) see see, , noticed second part of question. curl registers * closing connection #0 before print_r comes in, , when come in, comes in under prompt:

< http/1.1 302 found < date: thu, 18 apr 2013 16:14:55 gmt < server: apache/2.2.3 (red hat) < x-powered-by: php/5.3.3 < location: app.php?cart_item_id=1234567 < x-ua-compatible: ie=edge < content-length: 17 < connection: close < content-type: text/html; charset=utf-8 < * closing connection #0 <pre>before</pre>[user@localhost ~]$ 

so.... yeah. thoughts? mean, fine now, know why...

bass: ok, when curl, yahoo.com this:

[user@localhost~]$ curl yahoo.com -v * connect() yahoo.com port 80 (#0) *   trying 206.190.36.45... * connected * connected yahoo.com (206.190.36.45) port 80 (#0) > / http/1.1 > user-agent: curl/7.24.0 (x86_64-redhat-linux-gnu) libcurl/7.24.0 nss/3.13.5.0 zlib/1.2.5 libidn/1.18 libssh2/1.2.2 > host: yahoo.com > accept: */* > < http/1.1 301 redirect < date: fri, 19 apr 2013 13:28:10 gmt < connection: close < server: yts/1.20.13 < cache-control: no-store < content-type: text/html < content-language: en < location: http://www.yahoo.com/ < content-length: 211 < <head><title>redirect</title></head> <body bgcolor="white" fgcolor="black"> <font face="helvetica,arial"><b>  "<em>http://www.yahoo.com/</em>".<p></b></font>  <!-- default "redirect" response (301) --> </body> * closing connection #0 [user@localhost~]$ 

i * closing connection #0 after content. difference?

as iptables rule, there other allows, port 80, etc, follow after rule. guess.... bur... don't know...

as bass says, headers sent before print_r. moreover, iptables not "deep packet inspection", cannot see content of message.

difference of 2 line first 1 allow packets ip ip , second 1 allow packet established connection.

if no rule allows packets new connection. none of packet flow thought rule allowing established connection. (more information on connection tracking ?)


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -