Class HstsResolver

java.lang.Object
com.norconex.crawler.web.fetch.util.HstsResolver

public final class HstsResolver extends Object

Class handling HSTS support for servers supporting it. Upon encountering the first secure URL from a site, it caches whether the URL root domain returns an HTTP response containing a "Strict-Transport-Security" entry and if it includes sub-domains. Any non secure URL on that same site will be converted to https if requested by the HSTS server directive (if any).

To always convert "http" to "https" regardless of a site support for HSTS, you should rely on UrlNormalizer.secureScheme() instead.

Since:
3.0.0
  • Method Details

    • clearCache

      public static void clearCache()
    • resolve

      public static void resolve(org.apache.hc.client5.http.classic.HttpClient httpClient, WebCrawlerEntry docRecord)