mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-28 06:44:57 +02:00
Update:Remove local cover path input & replace with url from web input, include SSRF request filter
This commit is contained in:
parent
05731c9f72
commit
290a377ef9
20 changed files with 117 additions and 66 deletions
|
@ -1,7 +1,8 @@
|
|||
const fs = require('../libs/fsExtra')
|
||||
const rra = require('../libs/recursiveReaddirAsync')
|
||||
const axios = require('axios')
|
||||
const Path = require('path')
|
||||
const ssrfFilter = require('ssrf-req-filter')
|
||||
const fs = require('../libs/fsExtra')
|
||||
const rra = require('../libs/recursiveReaddirAsync')
|
||||
const Logger = require('../Logger')
|
||||
const { AudioMimeType } = require('./constants')
|
||||
|
||||
|
@ -210,7 +211,9 @@ module.exports.downloadFile = (url, filepath) => {
|
|||
url,
|
||||
method: 'GET',
|
||||
responseType: 'stream',
|
||||
timeout: 30000
|
||||
timeout: 30000,
|
||||
httpAgent: ssrfFilter(url),
|
||||
httpsAgent: ssrfFilter(url)
|
||||
}).then((response) => {
|
||||
const writer = fs.createWriteStream(filepath)
|
||||
response.data.pipe(writer)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue