Skip to content

Fix URL validation rejecting long TLDs like .clothing#1088

Open
busbyk wants to merge 1 commit into
mainfrom
fix/url-tld-validation
Open

Fix URL validation rejecting long TLDs like .clothing#1088
busbyk wants to merge 1 commit into
mainfrom
fix/url-tld-validation

Conversation

@busbyk
Copy link
Copy Markdown
Collaborator

@busbyk busbyk commented May 26, 2026

Description

An editor ran into a validation error when entering https://www.woolly.clothing/ in a sponsor link field. The URL validator capped TLDs at 6 characters, but modern TLDs like .clothing (8 chars), .photography (11 chars), and .international (13 chars) are valid.

Related Issues

Reported by editor (no GitHub issue)

Key Changes

  • Removed the 6-character upper bound on TLD length in src/utilities/validateUrl.ts
  • Retained the 2-character minimum and letters-only validation
  • Added test cases for long TLDs (.clothing, .photography, .international)

How to test

  1. Go to any Sponsor in the admin panel
  2. Enter https://www.woolly.clothing/ in the link field
  3. Save — should succeed without validation error
  4. Run pnpm test -- __tests__/client/utilities/validateUrl.client.test.ts

Screenshots / Demo video

N/A

Migration Explanation

No migration needed — validation logic only.

Future enhancements / Questions

None

🤖 Generated with Claude Code

Remove the 6-character upper bound on TLD length validation. Modern
TLDs can be much longer (e.g., .clothing, .photography, .international).
The minimum length of 2 and letters-only checks are retained.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

Preview deployment: https://fixxurl-tld-validation.preview.avy-fx.org

@busbyk busbyk marked this pull request as ready for review May 26, 2026 19:49
@busbyk busbyk requested a review from rchlfryn May 26, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants