Vug::UrlProcessor
Constants
Matches common feed URL path suffixes
Matches feed-like subdomains (e.g., feeds.example.com, feed.example.com)
Class methods
Derives the site root URL from a feed URL. For feed subdomains (e.g., feeds.example.com), strips the subdomain and returns the parent domain origin. For feed paths (e.g., example.com/atom.xml), strips the path and returns the origin. For non-feed URLs, returns the URL unchanged.
Extracts host from URL, handling feed URLs and HTTP/HTTPS schemes Sanitizes by removing /feed/ suffix and extracts hostname from URI
Returns true if the URL's host starts with a feed-like subdomain (e.g., feeds.example.com or feed.example.com).
Normalizes protocol-relative URLs (//example.com) to absolute URLs
Parse and validate a URL in one step: sanitize feed suffixes, validate scheme and host safety, and return a parsed URI. Returns nil if the URL is invalid, dangerous, or unparseable.
Resolves relative URLs and normalizes protocol-relative URLs in one step. If href is already absolute, it is normalized. If relative, it is resolved against base first, then normalized.
Convenience: sanitize a feed URL and derive the site root URL in one step.