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

Support whitelisting subdomains. #48

Closed
wants to merge 5 commits into from
Closed

Support whitelisting subdomains. #48

wants to merge 5 commits into from

Conversation

jsocol
Copy link
Contributor

@jsocol jsocol commented Oct 21, 2011

No description provided.

@@ -293,6 +292,25 @@ def delinkify(text, allow_domains=None, allow_relative=False):
return _render(forest)


def _domain_match(test, compare):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, naming is hard, but not idea which one of test or compare is the user data, and which one is developer-defined. Or if it even matters?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough.

('an.ex.am.pl', 'an.*.am.pl', True),
('a.ex.am.pl', 'an.*.am.pl', False),
('ex.am.pl', 'an.*.am.pl', False),
('an.ex.am.p.le', 'an.**.p.le', True),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't decide if this should pass or not. Tempted to either decide not to support **, or not allow anything in front of it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd support:

**.p.le

but not:

an.**.p.le

I'm not sure I see the use case there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I agree with that, but how to "not support" it? I'd like it to fail loudly. Throw ValueError or something?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, throw an error

@jsocol jsocol closed this in 1107510 Oct 24, 2011
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.

None yet

3 participants