Log in
Model

DomainValidator

Magento\Downloadable\Model\Url\DomainValidator

What it does

This class validates domain URLs for downloadable products in Magento 2.

Developers use it to ensure that file or sample URLs for downloadable products only point to whitelisted domains configured in the deployment settings, preventing links to unauthorized or potentially malicious external domains.

It checks that the URL host is not an IP address and matches one of the allowed domains.

Public Methods

  • isValid()