Skip to content

Commit

Permalink
fix: remove hostlist (#5522)
Browse files Browse the repository at this point in the history
  • Loading branch information
BiswaViraj authored and SokratisVidros committed May 13, 2024
1 parent 48fde99 commit 911df79
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ import { IsImageUrl } from '../../shared/validators/image.validator';

const environments = ['production', 'test'];
const protocols = environments.includes(process.env.NODE_ENV) ? ['https'] : ['http', 'https'];
const hostWhitelist = environments.includes(process.env.NODE_ENV) ? undefined : ['localhost', 'web.novu.co'];

export class UpdateBrandingDetailsDto {
@IsUrl({
require_protocol: true,
protocols,
host_whitelist: hostWhitelist,
require_tld: false,
})
@IsImageUrl({
message: 'Logo must be a valid image URL with one of the following extensions: jpg, jpeg, png, gif, svg',
Expand Down
3 changes: 1 addition & 2 deletions apps/api/src/app/user/dtos/update-profile-request.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import type { IUpdateUserProfile } from '@novu/shared';
import { IsImageUrl } from '../../shared/validators/image.validator';

const protocols = process.env.NODE_ENV === 'production' ? ['https'] : ['http', 'https'];
const hostWhitelist = ['production', 'test'].includes(process.env.NODE_ENV) ? undefined : ['localhost', 'web.novu.co'];

export class UpdateProfileRequestDto implements IUpdateUserProfile {
@ApiProperty()
Expand All @@ -18,7 +17,7 @@ export class UpdateProfileRequestDto implements IUpdateUserProfile {
@IsUrl({
require_protocol: true,
protocols,
host_whitelist: hostWhitelist,
require_tld: false,
})
@IsImageUrl({
message: 'Logo must be a valid image URL with one of the following extensions: jpg, jpeg, png, gif, svg',
Expand Down

0 comments on commit 911df79

Please sign in to comment.