fix: atomlink href (#2858)

This commit is contained in:
Cloud 2019-08-15 18:54:05 +08:00 committed by DIYgod
parent 4256068064
commit 4b4b1d492a
2 changed files with 3 additions and 1 deletions

View File

@ -57,7 +57,7 @@ module.exports = async (ctx, next) => {
lastBuildDate: new Date().toUTCString(),
updated: new Date().toISOString(),
ttl: routeTtl,
atomlink: ctx.request.path,
atomlink: ctx.request.href,
...ctx.state.data,
};
if (template) {

View File

@ -33,6 +33,8 @@ describe('template', () => {
const parsed2 = await parser.parseString(response2.text);
delete parsed1.lastBuildDate;
delete parsed2.lastBuildDate;
delete parsed1.feedUrl;
delete parsed2.feedUrl;
expect(parsed2).toMatchObject(parsed1);
});