[ 
https://issues.apache.org/jira/browse/SHINDIG-674?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646197#action_12646197
 ] 

Eiji Kitamura commented on SHINDIG-674:
---------------------------------------

This issue is because of User-Agent, not Redirection.
FeedBurner seems to change format of resulting feed by XSLT or something after 
redirection.
Since Shindig just passes browser's user-agent as is, the feed returns in 
format of HTML, not in XML.

Bottom is a proof patch.

To avoid this behavior, we can change User-Agent on fetching.
Java version seems to work properly, wonder how it's doing. I'll dig down.

Index: BasicRemoteContentFetcher.php
===================================================================
--- BasicRemoteContentFetcher.php       (revision 712603)
+++ BasicRemoteContentFetcher.php       (working copy)
@@ -44,11 +44,13 @@
                if ($request->hasHeaders()) {
                        $headers = explode("\n", $request->getHeaders());
                        $outHeaders = array();
+$outHeaders[] = "User-Agent: Shindig";
                        foreach ($headers as $header) {
                                if (strpos($header, ':')) {
                                        $key = trim(substr($header, 0, 
strpos($header, ':')));
                                        $val = trim(substr($header, 
strpos($header, ':') + 1));
-                                       if (strcasecmp($key, 
"Transfer-Encoding") != 0 && strcasecmp($key, "Cache-Control") != 0 && 
strcasecmp($key, "Expires") != 0 && strcasecmp($key, "Content-Length") != 0) {
+                                       if (strcasecmp($key, "User-Agent") != 0 
&& strcasecmp($key, "Transfer-Encoding") != 0 && strcasecmp($key, 
"Cache-Control") != 0 && strcasecmp($key, "Expires") != 0 && strcasecmp($key, 
"Content-Length") != 0) {
                                                $outHeaders[] = "$key: $val";
                                        }
                                }



> RSS Feeds with http redirects fail to parse
> -------------------------------------------
>
>                 Key: SHINDIG-674
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-674
>             Project: Shindig
>          Issue Type: Bug
>          Components: Gadget Rendering Server (PHP)
>            Reporter: Chris Chabot
>
> When a contentType=FEED gadgets.io.makeRequest is make for a feed url that 
> redirects, an error response ensues :)
> See http://adwordsapi.blogspot.com/atom.xml for example

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to