mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2024-11-16 13:17:30 +00:00
Fix feed blocked symbols and cache-control
This commit is contained in:
parent
1e92978c0d
commit
297c9a0c08
@ -24,7 +24,7 @@ module.exports = [
|
|||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
contentType: data.contentType,
|
contentType: data.contentType,
|
||||||
headers: {
|
headers: {
|
||||||
"Cache-Control": `max-age=${userRequestCache.getTtl("user/"+user.data.username, 1000)}`
|
"Cache-Control": `public, max-age=${userRequestCache.getTtl("user/"+user.data.username, 1000)}`
|
||||||
},
|
},
|
||||||
content: data.content
|
content: data.content
|
||||||
}
|
}
|
||||||
@ -36,11 +36,12 @@ module.exports = [
|
|||||||
message: "This user doesn't exist.",
|
message: "This user doesn't exist.",
|
||||||
withInstancesLink: false
|
withInstancesLink: false
|
||||||
})
|
})
|
||||||
} else if (error === constants.symbols.INSTAGRAM_DEMANDS_LOGIN) {
|
} else if (error === constants.symbols.INSTAGRAM_DEMANDS_LOGIN || error === constants.symbols.RATE_LIMITED) {
|
||||||
return {
|
return {
|
||||||
statusCode: 503,
|
statusCode: 503,
|
||||||
contentType: "text/html",
|
contentType: "text/html",
|
||||||
headers: {
|
headers: {
|
||||||
|
"Cache-Control": `public, max-age=${userRequestCache.getTtl("user/"+fill[0], 1000)}`,
|
||||||
"Retry-After": userRequestCache.getTtl("user/"+fill[0], 1000)
|
"Retry-After": userRequestCache.getTtl("user/"+fill[0], 1000)
|
||||||
},
|
},
|
||||||
content: pugCache.get("pug/blocked.pug").web({
|
content: pugCache.get("pug/blocked.pug").web({
|
||||||
|
Loading…
Reference in New Issue
Block a user