Skip to content

Commit

Permalink
Merge pull request #625 from energywebfoundation/allow_cors_without_tld
Browse files Browse the repository at this point in the history
chore: allow CORS from origin without top level domain
  • Loading branch information
JGiter authored Apr 4, 2023
2 parents c2b949e + c365735 commit 87e2ca2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/cors.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export function corsConfig(app: INestApplication) {
const configService = app.get(ConfigService);
const allowedOrigins = configService.get('ALLOWED_ORIGINS').split(',');
for (const origin of allowedOrigins) {
if (!isURL(origin)) {
if (!isURL(origin, { require_tld: false })) {
throw new Error(`Origin ${origin} is not a valid URL`);
}
}
Expand Down

0 comments on commit 87e2ca2

Please sign in to comment.