Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] What's the deal with HTTP_ACCEPT? (Was: Wanna see my open source project?)
- Date: Mon, 18 Aug 2008 12:46:09 +0900
- From: Edward Middleton <emiddleton@example.com>
- Subject: Re: [tlug] What's the deal with HTTP_ACCEPT? (Was: Wanna see my open source project?)
- References: <48A15C6C.2010607@articlass.org> <20080814115716.e612ddc1.gstewart@bonivet.net> <30ce84360808140423j53b267bcrb31b23ad1ebb139b@mail.gmail.com> <48A41AB0.7070003@articlass.org> <20080814125818.3988d466.gstewart@bonivet.net> <48A43932.6090405@articlass.org> <87myjfgw0d.fsf@uwakimon.sk.tsukuba.ac.jp> <20080814181314.0dd71775.jep200404@columbus.rr.com> <48A4F183.2040507@articlass.org> <1218856462.3150.9.camel@localhost.localdomain> <30ce84360808170313r613e51c4gb17344b5308c6436@mail.gmail.com> <48A8E1EA.3020900@articlass.org>
- User-agent: Thunderbird 2.0.0.14 (X11/20080711)
Dave M G wrote:$ac = strtolower($_SERVER['HTTP_ACCEPT']);
Long story short - some browsers don't send back a value for HTTP_ACCEPT, so it is not even empty, the entry doesn't even exist in the $_SERVER array. Since this variable is being looked at *before* the session starts, somehow the act of discovering it isn't there causes a session to get started, but not with the right data (probably a mostly empty $_SESSION array). From that point on, the mangled session causes everything to die horribly.
But I'm puzzled why this one entry in $_SERVER is so problematic. If it can't be found, why not simply return null or an empty string?
Because it isn't mandatory to include an accept header[1].
I am not sure why you would expect it to behave differently. Isn't $_SERVER['HTTP_ACCEPT'] dereferencing a hash with 'HTTP_ACCEPT' as the key. If there isn't a key then shouldn't it throw an exception or something.
Returning an empty string would be wrong because that would indicate the requester doesn't accept anything, where as the correct interpretation is '*/*' or accepts all.
Thus this
else { $ac = ''; }
should be
else { $ac = '*/*'; }
because '' would indicate it doesn't support any types and "then the server SHOULD send a 406 (not acceptable) response. "
Edward
1. http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
- References:
- [tlug] Thunderbird RSS different from FireFox?
- From: Dave M G
- Re: [tlug] Thunderbird RSS different from FireFox?
- From: Godwin Stewart
- Re: [tlug] Thunderbird RSS different from FireFox?
- From: Ian Wells
- Re: [tlug] Thunderbird RSS different from FireFox?
- From: Dave M G
- Re: [tlug] Thunderbird RSS different from FireFox?
- From: Godwin Stewart
- Re: [tlug] Thunderbird RSS different from FireFox?
- From: Dave M G
- Re: [tlug] Thunderbird RSS different from FireFox?
- From: Stephen J. Turnbull
- Sending Custom Headers (was Re: [tlug] Thunderbird RSS different from FireFox?)
- From: jep200404
- [tlug] Wanna see my open source project? (Was:Thunderbird RSS different from FireFox?)
- From: Dave M G
- Re: [tlug] Wanna see my open source project? (Was:Thunderbird RSS different from FireFox?)
- From: Kenneth M. Burling Jr.
- Re: [tlug] Wanna see my open source project? (Was:Thunderbird RSS different from FireFox?)
- From: Ian Wells
- [tlug] What's the deal with HTTP_ACCEPT? (Was: Wanna see my open source project?)
- From: Dave M G
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] What's the deal with HTTP_ACCEPT? (Was: Wanna see my open source project?)
- Next by Date: Re: [tlug] Microsoft embarassment during the Beijing Olympics opening ceremony
- Previous by thread: Re: [tlug] What's the deal with HTTP_ACCEPT? (Was: Wanna see my open source project?)
- Next by thread: Re: [tlug] Wanna see my open source project? (Was:Thunderbird RSS different from FireFox?)
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links