feat: force a certain language when getting data

when fetching data, sometimes it's returned in a language depending on server IP address.
 this
commit fixes that behaviour

https://github.com/zyachel/libremdb/issues/20
This commit is contained in:
zyachel 2022-11-13 17:39:29 +05:30
parent 5fd0d92187
commit 1658769a30
2 changed files with 4 additions and 1 deletions

View File

@ -10,7 +10,7 @@ NEXT_TELEMETRY_DISABLED=1
## default accept header is 'application/json, text/plain, */*'
# AXIOS_ACCEPT=
## for forcing a certain language for data we get from imdb
# AXIOS_LANGUAGE=en-US
# AXIOS_LANGUAGE='en-US,en;q=0.5'
### REDIS
## if you want to use redis to speed up the media proxy, set this to true

View File

@ -8,6 +8,9 @@ const axiosInstance = axios.create({
'User-Agent': process.env.AXIOS_USERAGENT,
}),
...(process.env.AXIOS_ACCEPT && { Accept: process.env.AXIOS_ACCEPT }),
...(process.env.AXIOS_LANGUAGE && {
'Accept-Language': process.env.AXIOS_LANGUAGE,
}),
},
});