From 08e5848d4a897447bddbc1b85d0d7173354061d7 Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Mon, 25 Jan 2016 17:56:05 +0000 Subject: [PATCH] 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 --- core/server/data/xml/sitemap/handler.js | 2 +- core/test/functional/routes/frontend_spec.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/server/data/xml/sitemap/handler.js b/core/server/data/xml/sitemap/handler.js index fc2b83951a..870a8bcf3a 100644 --- a/core/server/data/xml/sitemap/handler.js +++ b/core/server/data/xml/sitemap/handler.js @@ -1,5 +1,5 @@ var _ = require('lodash'), - utils = require('../../utils'), + utils = require('../../../utils'), sitemap = require('./index'); // Responsible for handling requests for sitemap files diff --git a/core/test/functional/routes/frontend_spec.js b/core/test/functional/routes/frontend_spec.js index 4fd651a86e..2640693ad8 100644 --- a/core/test/functional/routes/frontend_spec.js +++ b/core/test/functional/routes/frontend_spec.js @@ -1048,6 +1048,7 @@ describe('Frontend Routing', function () { it('should serve sitemap.xml', function (done) { request.get('/sitemap.xml') .expect(200) + .expect('Cache-Control', testUtils.cacheRules.hour) .expect('Content-Type', 'text/xml; charset=utf-8') .end(doEnd(done)); }); @@ -1055,6 +1056,7 @@ describe('Frontend Routing', function () { it('should serve sitemap-posts.xml', function (done) { request.get('/sitemap-posts.xml') .expect(200) + .expect('Cache-Control', testUtils.cacheRules.hour) .expect('Content-Type', 'text/xml; charset=utf-8') .end(doEnd(done)); }); @@ -1062,6 +1064,7 @@ describe('Frontend Routing', function () { it('should serve sitemap-pages.xml', function (done) { request.get('/sitemap-posts.xml') .expect(200) + .expect('Cache-Control', testUtils.cacheRules.hour) .expect('Content-Type', 'text/xml; charset=utf-8') .end(doEnd(done)); });