Skip to content
This repository was archived by the owner on May 28, 2023. It is now read-only.

Commit f5fe6cf

Browse files
author
Fifciuu
committed
Typo fix
1 parent d5a7c3c commit f5fe6cf

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/api/catalog.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export default ({config, db}) => async function (req, res, body) {
179179
res.setHeader('X-VS-Cache', 'Hit')
180180
if (config.get('varnish.enabled')) {
181181
const tagsHeader = output.tags.join(' ')
182-
res.setHeader('X-VS-Cache-Tags', tagsHeader)
182+
res.setHeader('X-VS-Cache-Tag', tagsHeader)
183183
delete output.tags
184184
}
185185
res.json(output)

src/api/invalidate.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ function invalidateCache (req, res) {
1212
}
1313

1414
if (req.query.tag) { // clear cache pages for specific query tag
15-
1615
console.log(`Clear cache request for [${req.query.tag}]`)
1716
let tags = []
1817
if (req.query.tag === '*') {
@@ -31,18 +30,19 @@ function invalidateCache (req, res) {
3130
request(
3231
{
3332
uri: `http://${config.get('varnish.host')}:${config.get('varnish.port')}/`,
34-
method: "BAN",
33+
method: 'BAN',
3534
headers: {
3635
// I should change Tags -> tag
37-
"X-VS-Cache-Tags": tag
36+
'X-VS-Cache-Tag': tag
3837
}
3938
},
4039
(err, res, body) => {
41-
if (body && body.includes("200 Ban added")) {
40+
if (body && body.includes('200 Ban added')) {
4241
console.log(
4342
`Tags invalidated successfully for [${tag}] in the Varnish`
4443
);
4544
} else {
45+
console.log(body)
4646
console.error(`Couldn't ban tag: ${tag} in the Varnish`);
4747
}
4848
}
@@ -77,13 +77,13 @@ function invalidateCache (req, res) {
7777
request(
7878
{
7979
uri: `http://${config.get('varnish.host')}:${config.get('varnish.port')}/`,
80-
method: "BAN",
80+
method: 'BAN',
8181
headers: {
82-
"X-VS-Cache-Ext": ext
82+
'X-VS-Cache-Ext': ext
8383
}
8484
},
8585
(err, res, body) => {
86-
if (body && body.includes("200 Ban added")) {
86+
if (body && body.includes('200 Ban added')) {
8787
console.log(
8888
`Cache invalidated successfully for [${ext}] in the Varnish`
8989
);
@@ -95,7 +95,7 @@ function invalidateCache (req, res) {
9595
}
9696
apiStatus(
9797
res,
98-
"Cache invalidation succeed",
98+
'Cache invalidation succeed',
9999
200
100100
);
101101
} else {

0 commit comments

Comments
 (0)