tags:

views:

369

answers:

3

I'm creating a web site and I'm having trouble getting FireFox to ask me where to add the feed when I open it. I used the tag to add the RSS icon, and it leads to a page that provides a valid Atom feed according to the W3C validator. When the content type is "text/html", I get the content of the xml tags concatenated. When I serve "application/atom+xml", Firefox asks me if I want to save the file to my desktop. Safari recognized the feed and acts appropriately. Is there another header or tag in the feed that tells Firefox to act like it's a feed?

+1  A: 

Feed for this very page is an Atom feed and Firefox recognizes it as such. Maybe you should set content-type header to "application/xhtml+xml" which is what stackoverflow is doing.

vava
This didn't fix the problem but it did put FireFox into a strict mode which showed what the problem was. Thanks.
Dan Goldstein
A: 

Firefox should get from "Content-Type: application/atom+xml; charset=UTF-8" http header from server. What http headers firefox is getting you can check with this plug-in: http://livehttpheaders.mozdev.org/

softly.lt
+1  A: 

Well, your feed need only confirm to the Atom specifications. If it confirms Firefox will display it as such. Are you putting in the right header and namespace?

 <?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"&gt;

I don't think you need to worry about changing the header if you do that. I've worked with RSS (not Atom) feeds in the past and have never had to change the header as long as the feed was formatted correctly.

Cyril Gupta
Because my atom feed was in a templating language, the first line of the feed was blank and my XML declaration was on the second line. Thanks.
Dan Goldstein