Skip to content

Commit

Permalink
Auto formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
advplyr committed Jan 1, 2025
1 parent d7830f4 commit f3918a4
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions server/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,24 @@ class Server {
global.AllowCors = process.env.ALLOW_CORS === '1'

if (process.env.EXP_PROXY_SUPPORT === '1') {
Logger.info(`[Server] Experimental Proxy Support Enabled, SSRF Request Filter was Disabled`);
// https://github.com/advplyr/audiobookshelf/pull/3754
Logger.info(`[Server] Experimental Proxy Support Enabled, SSRF Request Filter was Disabled`)
global.DisableSsrfRequestFilter = () => true
axios.defaults.maxRedirects = 0;

axios.defaults.maxRedirects = 0
axios.interceptors.response.use(
response => response,
error => {
(response) => response,
(error) => {
if ([301, 302].includes(error.response?.status)) {
return axios({
...error.config,
url: error.response.headers.location,
});
url: error.response.headers.location
})
}
return Promise.reject(error);

return Promise.reject(error)
}
);
)
} else if (process.env.DISABLE_SSRF_REQUEST_FILTER === '1') {
Logger.info(`[Server] SSRF Request Filter Disabled`)
global.DisableSsrfRequestFilter = () => true
Expand Down

0 comments on commit f3918a4

Please sign in to comment.