[wp-trac] [WordPress Trac] #36334: Custom RSS feed has wrong MIME type and forces download in browser
WordPress Trac
noreply at wordpress.org
Fri Mar 25 18:37:44 UTC 2016
#36334: Custom RSS feed has wrong MIME type and forces download in browser
--------------------------+-----------------------------
Reporter: Missilesilo | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Feeds | Version: 4.4.2
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
When adding a custom RSS feed using add_feed(), the resulting feed is
transferred to the document with the wrong MIME type and forces a
download. Built in feeds behave properly.
{{{
<?php
add_action('init', 'customRSS');
function customRSS(){
add_feed('feedname', 'customRSSFunc');
}
function customRSSFunc(){
echo 'say anything';
// get_template_part('rss', 'feedname');
}
?>
}}}
Navigating to http://wordpress.dev/feed/feedname/ results in forced
download and console message:
{{{
Resource interpreted as Document but transferred with MIME type
application/octet-stream: "http://wordpress.dev/feed/feedname/".
}}}
This occurs on a fresh install of WordPress 4.4.2 with no added plugins.
The above code is the only contents of functions.php in a child theme of
Twenty Sixteen. Browser/OS is Google Chrome 48.0.2564.116 (64-bit) on Mac
OSX 10.11.3. Test website is running on a local Vagrant/VirtualBox server.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36334>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list