Skip to content

feat: support trailing dots in hostnames#23

Merged
qjerome merged 1 commit intomainfrom
feat/trailing-dot-support
Mar 3, 2026
Merged

feat: support trailing dots in hostnames#23
qjerome merged 1 commit intomainfrom
feat/trailing-dot-support

Conversation

@qjerome
Copy link
Collaborator

@qjerome qjerome commented Mar 3, 2026

Summary
Support parsing URLs and domains containing a trailing dot in the hostname (e.g., http://shops.myshopify.com./). This addresses issue #18.

Motivation
URLs with trailing dots in hostnames are valid according to RFC standards but were previously rejected by the parser. This change enables proper parsing of such URLs while maintaining backward compatibility.

Changes

  • Modified parser's grammar
  • Added trim_end_matches(".") to strip trailing dots from hostnames during parsing
  • Added test coverage for trailing dot scenarios

Breaking Changes
None

Testing

  • Added test_url_trailing_dot() with multiple test cases
  • All existing tests continue to pass
  • Verified parsing of trailing dots with various URL components (path, query, fragment, port, userinfo)

Notes
The trailing dot is stripped during parsing but the original URL string remains unchanged in the orig field.

Support parsing URLs with trailing dots in hostnames (e.g., shops.myshopify.com./)
by modifying grammar rules and adding trailing dot trimming.

This addresses issue #18.
@qjerome qjerome merged commit 4793334 into main Mar 3, 2026
19 checks passed
@qjerome qjerome deleted the feat/trailing-dot-support branch March 3, 2026 10:44
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.

1 participant