mirror of
https://github.com/wallabag/wallabag.git
synced 2025-01-03 13:28:41 +00:00
Handle redirection from previous feeds
This commit is contained in:
parent
f277bc042c
commit
68a90821a3
2 changed files with 69 additions and 0 deletions
|
@ -59,3 +59,39 @@ fos_js_routing:
|
||||||
|
|
||||||
2fa_login_check:
|
2fa_login_check:
|
||||||
path: /2fa_check
|
path: /2fa_check
|
||||||
|
|
||||||
|
# redirect RSS feed to Atom
|
||||||
|
rss_to_atom_unread:
|
||||||
|
path: /{username}/{token}/unread.xml
|
||||||
|
defaults:
|
||||||
|
_controller: FrameworkBundle:Redirect:redirect
|
||||||
|
route: unread_feed
|
||||||
|
permanent: true
|
||||||
|
|
||||||
|
rss_to_atom_archive:
|
||||||
|
path: /{username}/{token}/archive.xml
|
||||||
|
defaults:
|
||||||
|
_controller: FrameworkBundle:Redirect:redirect
|
||||||
|
route: archive_feed
|
||||||
|
permanent: true
|
||||||
|
|
||||||
|
rss_to_atom_starred:
|
||||||
|
path: /{username}/{token}/starred.xml
|
||||||
|
defaults:
|
||||||
|
_controller: FrameworkBundle:Redirect:redirect
|
||||||
|
route: starred_feed
|
||||||
|
permanent: true
|
||||||
|
|
||||||
|
rss_to_atom_all:
|
||||||
|
path: /{username}/{token}/all.xml
|
||||||
|
defaults:
|
||||||
|
_controller: FrameworkBundle:Redirect:redirect
|
||||||
|
route: all_feed
|
||||||
|
permanent: true
|
||||||
|
|
||||||
|
rss_to_atom_tags:
|
||||||
|
path: /{username}/{token}/tags/{slug}.xml
|
||||||
|
defaults:
|
||||||
|
_controller: FrameworkBundle:Redirect:redirect
|
||||||
|
route: tag_feed
|
||||||
|
permanent: true
|
||||||
|
|
|
@ -225,4 +225,37 @@ class FeedControllerTest extends WallabagCoreTestCase
|
||||||
$client->request('GET', '/feed/admin/SUPERTOKEN/tags/foo/3000');
|
$client->request('GET', '/feed/admin/SUPERTOKEN/tags/foo/3000');
|
||||||
$this->assertSame(302, $client->getResponse()->getStatusCode());
|
$this->assertSame(302, $client->getResponse()->getStatusCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function dataForRedirect()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
[
|
||||||
|
'/admin/YZIOAUZIAO/unread.xml',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'/admin/YZIOAUZIAO/starred.xml',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'/admin/YZIOAUZIAO/archive.xml',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'/admin/YZIOAUZIAO/all.xml',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'/admin/YZIOAUZIAO/tags/foo.xml',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dataProvider dataForRedirect
|
||||||
|
*/
|
||||||
|
public function testRedirectFromRssToAtom($url)
|
||||||
|
{
|
||||||
|
$client = $this->getClient();
|
||||||
|
|
||||||
|
$client->request('GET', $url);
|
||||||
|
|
||||||
|
$this->assertSame(301, $client->getResponse()->getStatusCode());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue