Skip to content
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

🐛 Bug Report: Unable to use .community domains as custom domains in firefox #474

Closed
2 tasks done
MaximumMaxxx opened this issue Jul 5, 2023 · 4 comments
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@MaximumMaxxx
Copy link

👟 Reproduction steps

  • Go to any project and try to add a custom domain
  • Enter a domain ending with .community

👍 Expected behavior

The form should accept .community domains and move on to the next step

image

👎 Actual Behavior

You get a "Must be a valid domain error"

image

Note that it is possible to bypass this error by changing the validation pattern on the form
image

🎲 Appwrite version

Appwrite Cloud

💻 Operating system

Windows

🧱 Your Environment

No response

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@MaximumMaxxx MaximumMaxxx added the bug Something isn't working label Jul 5, 2023
@MaximumMaxxx
Copy link
Author

Also just noticed that this issue only seems to happen in ff. Chrome works as expected

@MaximumMaxxx MaximumMaxxx changed the title 🐛 Bug Report: Unable to use .community domains as custom domains 🐛 Bug Report: Unable to use .community domains as custom domains in firefox Jul 5, 2023
@MaximumMaxxx
Copy link
Author

MaximumMaxxx commented Jul 5, 2023

I think I've narrowed down the problem to this part of the regex

^(?!-)[A-Za-z0-9-]+([\-\.]{1}[a-z0-9]+)*\.[A-Za-z]{2,6}$
                                                     ^

Any tld longer than 6 characters doesn't get matched. Which works fine except that some tlds are longer than 6 characters as seen with .contractors. The longest is in fact 24 (XN--VERMGENSBERATUNG-PWB), although it could theorertically be up to 63 characters

image

image

The solution would be to bump the limit to either 24 or 63

^(?!-)[A-Za-z0-9-]+([\-\.]{1}[a-z0-9]+)*\.[A-Za-z]{2,63}$
                                                     ^

Although that actually wouldn't work for all domains since "-" is not included in the filter, so actually adding a dash would allow proper matching of big domains

^(?!-)[A-Za-z0-9-]+([\-\.]{1}[a-z0-9]+)*\.[A-Za-z-]{2,63}$
                                                 ^

@stnguyen90
Copy link
Contributor

Closing as a duplicate of appwrite/appwrite#5273

@stnguyen90 stnguyen90 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants