PHP Image Host - Sending HTTP Headers Twice?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a php script which serves an image. It's very simple:

header('Content-Type: image/' . $ImageData['content_type']);
readfile($File);

When viewing the script with the Firefox Extension: LiveHTTPHeaders,
it gives the following output for a SINGLE request:

----------------------------------------------------------
https://domain.tld/img.php?i=260

GET /img.php?i=260 HTTP/1.1
Host: domain.tld
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US;
rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: UTF-8,*
Keep-Alive: 115
Connection: keep-alive
Cookie: session=blahblah
Cache-Control: max-age=0

HTTP/1.1 200 OK
Server: nginx
Date: Mon, 10 May 2010 20:17:09 GMT
Content-Type: image/jpeg
Transfer-Encoding: chunked
Connection: keep-alive
----------------------------------------------------------
https://domain.tld/img.php?i=260

GET /img.php?i=260 HTTP/1.1
Host: domain.tld
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US;
rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: UTF-8,*
Keep-Alive: 115
Connection: keep-alive

HTTP/1.1 200 OK
Server: nginx
Date: Mon, 10 May 2010 20:17:10 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Content-Encoding: gzip
----------------------------------------------------------



As you can see, the browser is requesting the image twice, and PHP is
sending two different Content-Type headers. Why is this?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux