mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-03-10 00:17:21 +01:00
Add Accept-Encoding header to getPodcastFeed()
This commit adds the Accept-Encoding header to getPodcastFeed() with gzip, compress, and deflate support. This allows servers to send a compressed response that'll be decompressed by axios transparently. Audiobookshelf is currently using axios v0.27.2, which enables the decompress option by default. The decompress feature supports gzip, compress, and deflate algorithms (see axios/lib/adapters/http.js). axios v0.27.2 does not add the Accept-Encoding header to requests automatically, so that's the responsibility of the caller.
This commit is contained in:
parent
5e5a604d03
commit
3f7af8acfb
@ -311,6 +311,7 @@ module.exports.getPodcastFeed = (feedUrl, excludeEpisodeMetadata = false) => {
|
||||
responseType: 'arraybuffer',
|
||||
headers: {
|
||||
Accept: 'application/rss+xml, application/xhtml+xml, application/xml, */*;q=0.8',
|
||||
'Accept-Encoding': 'gzip, compress, deflate',
|
||||
'User-Agent': userAgent
|
||||
},
|
||||
httpAgent: global.DisableSsrfRequestFilter?.(feedUrl) ? null : ssrfFilter(feedUrl),
|
||||
|
Loading…
Reference in New Issue
Block a user