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

Guess domain name with hyphen(s) correctly #57

Closed
petermeissner opened this issue Jul 21, 2020 · 1 comment · Fixed by #56
Closed

Guess domain name with hyphen(s) correctly #57

petermeissner opened this issue Jul 21, 2020 · 1 comment · Fixed by #56

Comments

@petermeissner
Copy link
Contributor

Hi! In v0.7.7, robotstxt:::guess_domain("www.some-domain.com") returns www.some, also when prefixing http(s):// or suffixing /some/path/index.html.

see: #56

@petermeissner petermeissner linked a pull request Jul 21, 2020 that will close this issue
@petermeissner petermeissner reopened this Jul 22, 2020
@petermeissner
Copy link
Contributor Author

to make the regex in parse_url() more general ...

... instead of (allowing hyphens) ...

stringr::str_match(url, "(^\\w+://)?([\\w.-]+)?(/.*)?")[, -1, drop = FALSE]

... use (only disallowing slashes):

stringr::str_match(url, "(^\\w+://)?([^/]+)?(/.*)?")[, -1, drop = FALSE]

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 a pull request may close this issue.

1 participant