seomoz / url-py

URL Transformation, Sanitization
MIT License
103 stars 20 forks source link

Check segment size #42

Closed dlecocq closed 8 years ago

dlecocq commented 8 years ago

Pair of https://github.com/seomoz/url-cpp/pull/22

@b4hand @lindseyreno @tammybailey

neilmb commented 8 years ago

LGTM, good test.

dlecocq commented 8 years ago

I'm not sure we should only do this check in punycode or if we should do it at parse time (in the old url-py, it was the IDNA codec that detected this). To that end, I pulled it out into its own function so we can drop it wherever we want later.

On the one hand, it's only a problem for DNS, not URLs per se. And punycode is the only part that is interested in DNS, so it would make sense that it would be detected there. On the other hand, any URLs we deal with practically will probably deal with DNS.

b4hand commented 8 years ago

LGTM