Skip to content

Commit 08e5848

Browse files
committed
Fix cache-control header for sitemaps
no issue - sitemaps were getting max-age=undefined as they were depending on the wrong utils folder - test + fix included
1 parent e5e3750 commit 08e5848

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

core/server/data/xml/sitemap/handler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var _ = require('lodash'),
2-
utils = require('../../utils'),
2+
utils = require('../../../utils'),
33
sitemap = require('./index');
44

55
// Responsible for handling requests for sitemap files

core/test/functional/routes/frontend_spec.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,20 +1048,23 @@ describe('Frontend Routing', function () {
10481048
it('should serve sitemap.xml', function (done) {
10491049
request.get('/sitemap.xml')
10501050
.expect(200)
1051+
.expect('Cache-Control', testUtils.cacheRules.hour)
10511052
.expect('Content-Type', 'text/xml; charset=utf-8')
10521053
.end(doEnd(done));
10531054
});
10541055

10551056
it('should serve sitemap-posts.xml', function (done) {
10561057
request.get('/sitemap-posts.xml')
10571058
.expect(200)
1059+
.expect('Cache-Control', testUtils.cacheRules.hour)
10581060
.expect('Content-Type', 'text/xml; charset=utf-8')
10591061
.end(doEnd(done));
10601062
});
10611063

10621064
it('should serve sitemap-pages.xml', function (done) {
10631065
request.get('/sitemap-posts.xml')
10641066
.expect(200)
1067+
.expect('Cache-Control', testUtils.cacheRules.hour)
10651068
.expect('Content-Type', 'text/xml; charset=utf-8')
10661069
.end(doEnd(done));
10671070
});

0 commit comments

Comments
 (0)