1
0
mirror of https://git.sr.ht/~cadence/bibliogram synced 2025-12-18 03:58:49 +00:00

Auto-refresh expired profile pictures

This commit is contained in:
Cadence Ember
2020-04-05 02:57:31 +12:00
parent f4969f86db
commit 9fd9a00932
7 changed files with 143 additions and 16 deletions

View File

@@ -5,6 +5,13 @@ function proxyImage(url, width) {
return "/imageproxy?"+params.toString()
}
function proxyProfilePic(url, userID) {
const params = new URLSearchParams()
params.set("userID", userID)
params.set("url", url)
return "/imageproxy?"+params.toString()
}
function proxyVideo(url) {
const params = new URLSearchParams()
params.set("url", url)
@@ -21,5 +28,6 @@ function proxyExtendedOwner(owner) {
}
module.exports.proxyImage = proxyImage
module.exports.proxyProfilePic = proxyProfilePic
module.exports.proxyVideo = proxyVideo
module.exports.proxyExtendedOwner = proxyExtendedOwner

View File

@@ -25,7 +25,8 @@ class Got {
*/
response() {
return this.send().instance.then(res => ({
status: res.statusCode
status: res.statusCode,
headers: new Map(Object.entries(res.headers))
}))
}

View File

@@ -1,6 +1,7 @@
/**
* @typedef GrabResponse
* @property {number} status
* @property {Map<string, string|string[]} headers
*/
// @ts-nocheck
@@ -14,7 +15,7 @@ class GrabReference {
throw new Error("This is the reference class, do not instantiate it.")
}
// Please help me type this
// Please help me write typings for stream()
/**
* @returns {Promise<any>}
*/