Add guard to prevent recursive proxying even when origin=1
Signed-off-by: eternal-flame-AD <yume@yumechi.jp>
This commit is contained in:
parent
fb690169f3
commit
086532218e
1 changed files with 6 additions and 0 deletions
|
@ -319,6 +319,12 @@ export class FileServerService {
|
|||
);
|
||||
}
|
||||
|
||||
if (!request.headers['user-agent']) {
|
||||
throw new StatusError('User-Agent is required', 400, 'User-Agent is required');
|
||||
} else if (request.headers['user-agent'].includes(this.config.userAgent)) {
|
||||
throw new StatusError('Proxy is recursive', 400, 'Proxy is recursive');
|
||||
}
|
||||
|
||||
// Create temp file
|
||||
const file = await this.getStreamAndTypeFromUrl(url);
|
||||
if (file === '404') {
|
||||
|
|
Loading…
Reference in a new issue