Http content negotiation issues

This isn’t for users yet. This is preliminary to get a sense of what’s happening so hopefully a work-around can be figured out.

I’ll try it on my server with Firefox and Opera and see what I get.

According to Mozilla, the only browser that send svg in the HTTP Accept header is IE 9.

$_SERVER[“HTTP_ACCEPT”] <- this means that the server supports SVG, not the browser…

Either you’re thinking of something else or I’ve been grossly mistaken for quite some time. Got a link to the PHP docs to support this?

Not to worry, Mittineague. You are not wrong. HTTP Accept is what the browser sends. Johnnyschultz is mistaken.

I feel that we are back to square one :frowning:
Especially because Mittineague said in post 21 that the email method pretty much not ready for use. only for testing, like some parts of css3.

So now is the redirect / email method gone?

And we know that the $_SERVER[“HTTP_ACCEPT”] idea is gone too because browsers don’t include image/svg+xml in their accept_headers.
well besides IE. Meaning— for once, IE is ahead of the game :eek :

Am I correct that we are back to the beginning in terms of finding a proper PHP solution to svg support and other-image type fallbacks ?

I did some experimenting (with my older browsers)

Firefox
headertest.php request:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,/;q=0.5
headertest.css request:
text/css,/;q=0.1
headertest.svg request:
image/png,/;q=0.5

Opera
headertest.php request:
text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, /;q=0.1
headertest.css request:
text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, /;q=0.1
headertest.svg request:
text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, /;q=0.1

from http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

with “/” indicating all media types

So there is some difference, but sending a catch-all “wildcard” isn’t much help.

The javascript returned “true” for both browsers, but I was unable to get an SVG file to render as a background or inline image. Though both display OK if opened directly outside of a web page. I get the feeling I’m missing something but can’t put my finger on it.

idk if you have IE or not, but I tried that and I swear that for headertest.svg, it accepted the image/xml+svg header!

Also, this might be an idea. I know this is a strange request, as if all of this hasn’t been, but I found this open source API / Library that says it can do content negotiation (without browse sniffing, I believe by looking at the source), but I can’t seem to figure out how to use the API to do content negotiation :lol:

The author provides an example for negotiation with xhtml, but that didn’t help my efforts.

I tried contacting the author, but he hasn’t responded, which I believe may be due to that the email he left to be contacted by is at the domain where I found the script.
And that site only has this script.

Here is another copy the zip file that I downloaded (attached):

Any ideas or would you be willing to take a shot at it?