mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2024-11-26 09:37:28 +00:00
Fix error response caching
This commit is contained in:
parent
456bafa199
commit
1e92978c0d
@ -86,7 +86,6 @@ async function fetchUser(username, context) {
|
|||||||
* @returns {Promise<import("./structures/User")>}
|
* @returns {Promise<import("./structures/User")>}
|
||||||
*/
|
*/
|
||||||
function fetchUserFromHTML(username) {
|
function fetchUserFromHTML(username) {
|
||||||
return userRequestCache.getOrFetch("user/"+username, false, true, () => {
|
|
||||||
if (constants.caching.self_blocked_status.enabled) {
|
if (constants.caching.self_blocked_status.enabled) {
|
||||||
if (history.store.has("user")) {
|
if (history.store.has("user")) {
|
||||||
const entry = history.store.get("user")
|
const entry = history.store.get("user")
|
||||||
@ -95,6 +94,7 @@ function fetchUserFromHTML(username) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return userRequestCache.getOrFetch("user/"+username, false, true, () => {
|
||||||
return switcher.request("user_html", `https://www.instagram.com/${username}/`, async res => {
|
return switcher.request("user_html", `https://www.instagram.com/${username}/`, async res => {
|
||||||
if (res.status === 301) throw constants.symbols.ENDPOINT_OVERRIDDEN
|
if (res.status === 301) throw constants.symbols.ENDPOINT_OVERRIDDEN
|
||||||
if (res.status === 302) throw constants.symbols.INSTAGRAM_DEMANDS_LOGIN
|
if (res.status === 302) throw constants.symbols.INSTAGRAM_DEMANDS_LOGIN
|
||||||
|
Loading…
Reference in New Issue
Block a user