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

Multi-level domain suffixes throw errors when purging URLs #22

Closed
kswilliames opened this issue Jul 31, 2020 · 2 comments
Closed

Multi-level domain suffixes throw errors when purging URLs #22

kswilliames opened this issue Jul 31, 2020 · 2 comments
Assignees
Labels

Comments

@kswilliames
Copy link
Contributor

When purging an entry URL on save or a specific URL from the dashboard widget, I'm encountering an "Invalid URL" error.

It is throwing on zones with domains that are more than one level eg. www.example.org.au/path/to/something. The URLHelper is cutting these URLs down to 'org.au' and comparing that to the registrable domain 'example.org.au', which always fails the isPurgeableUrl check.

The most reliable way of determining the registrable domain is by using the Public Suffix List. I've made a pull request with a plugin that extracts domains using a cached public list.

Thanks for a great plugin!

@gbowne-quickbase
Copy link

gbowne-quickbase commented Aug 18, 2020

I am seeing similar behavior when trying to purge www.example.com/path/to/something and but the Plugin throws a Ignoring URL outside zone error.
Looking into it, the comparison between the $urlDomain and the $cfDomainName provided by the UrlHelper yields a comparison between example.com and www.example.com (from my Zone) which never match.

If I essentially ignore that check, my purges go through perfectly. Alternately, I was able to throw the zoneName into the config.php file and voila. Our zone name is a three part URL (www.example.com) because it's part of a larger account with other zones based on example.com

@mattstein mattstein self-assigned this Dec 28, 2020
@mattstein
Copy link
Contributor

Just released v1.0.0 with an update for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants