From b12e45fa2a0a20464094db03c83edd94b4977790 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Thu, 24 May 2018 16:22:14 +0800 Subject: [PATCH] app: more precise template typeRegrx --- middleware/template.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware/template.js b/middleware/template.js index 2691d6fc6..53fe43038 100644 --- a/middleware/template.js +++ b/middleware/template.js @@ -1,7 +1,7 @@ const art = require('art-template'); const path = require('path'); const config = require('../config'); -const typeRegrx = /\.([a-z]+)$/; +const typeRegrx = /\.(atom|rss|json)$/; module.exports = async (ctx, next) => { ctx.state.type = ctx.request.path.match(typeRegrx) || ['', ''];