feat: upload from url, prevent internal access
This commit is contained in:
parent
f55253d1ab
commit
13fedeca8b
1 changed files with 5 additions and 0 deletions
|
|
@ -1,9 +1,14 @@
|
|||
import { IsDefined, IsString, Validate } from 'class-validator';
|
||||
import { ValidUrlExtension } from '@gitroom/helpers/utils/valid.url.path';
|
||||
import { IsSafeWebhookUrl } from '@gitroom/nestjs-libraries/dtos/webhooks/webhook.url.validator';
|
||||
|
||||
export class UploadDto {
|
||||
@IsString()
|
||||
@IsDefined()
|
||||
@Validate(ValidUrlExtension)
|
||||
@IsSafeWebhookUrl({
|
||||
message:
|
||||
'URL must be a public HTTPS URL and cannot point to internal network addresses',
|
||||
})
|
||||
url: string;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue