mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-02-22 13:19:05 +00:00
fix: url upload fetch timeout failsafe
This commit is contained in:
parent
93dc820368
commit
cc5625fabf
@ -613,6 +613,11 @@ self.actuallyUploadUrls = async (req, res, data = {}) => {
|
||||
// Reduce GET timeout by time already spent for HEAD request
|
||||
const _timeout = urlFetchTimeout - (Date.now() - headStart)
|
||||
|
||||
// Skip early if HEAD fetch took too long
|
||||
if (_timeout <= 0) {
|
||||
throw new ClientError('Fetch timed out. Try again?')
|
||||
}
|
||||
|
||||
const fetchFile = await utils.fetch(url, {
|
||||
method: 'GET',
|
||||
size: urlMaxSizeBytes, // limit max response body size
|
||||
|
Loading…
Reference in New Issue
Block a user