-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add advanced setting for enabling plain HTTP domains #403
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
a75a5d6
to
0a992c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me other than the few comments
apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/domains/page-client.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments below. btw when doing UI changes, add a screenshot of the new UI for the reviewers
apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/domains/page-client.tsx
Outdated
Show resolved
Hide resolved
also, can you add an E2E test for this? |
apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/domains/page-client.tsx
Outdated
Show resolved
Hide resolved
.transform((value) => 'https://' + value) | ||
domain: yup.string() | ||
.matches(DOMAIN_REGEX, "Invalid domain") | ||
.test('is-domain', (domain) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The custom Yup test always uses 'https://' when calling createUrlIfValid. Consider referencing the allowInsecureHttp flag (via this.parent) so that if plain HTTP is enabled, the proper protocol is validated. Also consider adding an explicit error message for clarity.
@TheCactusBlue can you add E2E tests, and then merge this? |
`); | ||
}); | ||
|
||
it("should not allow protocols other than http(s) in trusted domains", async ({ expect }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test description 'should not allow protocols other than http(s)' is inconsistent with the inline snapshot which still returns status 200 and includes the 'whatever://' protocol. Please verify if disallowed protocols should result in an error response.
Important
Add support for enabling plain HTTP domains for development in domain configuration and validation.
allowInsecureHttp
boolean to domain configuration inpage-client.tsx
.allowInsecureHttp
is true.EditDialog
.projectTrustedDomainSchema
and updateddomainSchema
to allow HTTP.projects.test.ts
for allowing HTTP domains and rejecting non-HTTP protocols.This description was created by
for 735fba1. It will automatically update as commits are pushed.