Skip to content

Commit ca20691

Browse files
Updated the URL validation regex to have maximum TLD length of 63 characters
1 parent a0406ff commit ca20691

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/common/constants.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const UNSPLASH_BASE_URL = "https://api.unsplash.com/search/photos";
3838
export const DIRECT_UPLOAD_ENDPOINT = "/api/direct_uploads";
3939

4040
export const URL_REGEXP =
41-
/[(http(s)?)://(www.)?a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/;
41+
/[(http(s)?)://(www.)?a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/;
4242

4343
export const YOUTUBE_URL_REGEXP =
4444
/^((?:https?:)?\/\/)?((?:www|m)\.)?((?:youtube\.com|youtu.be))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S*?)(\?[^#]*)?$/;

0 commit comments

Comments
 (0)