Skip to content

v0.6.0

Latest

Choose a tag to compare

@milmazz milmazz released this 13 Jun 23:21
· 1 commit to main since this release
1f855c9

Added

  • Exoplanet.Sanitizer behaviour: optionally delegate HTML sanitization to a
    comprehensive library (e.g. html_sanitize_ex) via
    config :exoplanet, sanitizer_adapter: MyAdapter. When set, the adapter
    replaces the built-in sanitizer.
  • CONTRIBUTING.md with development setup, test conventions, and the
    DateTimeParser regeneration workflow.

Changed

  • feed_timeout is now enforced at the HTTP layer as Req's
    :receive_timeout (it previously only bounded the surrounding task), and
    Req's automatic retries are now disabled by default — a retried request
    could never finish inside the task backstop anyway, and a prompt error
    return is what enables the cached-body fallback. Re-enable retries via
    :req_options if you need them.
  • Exoplanet.Config.from_file/1 and Exoplanet.build/1 now share one
    canonical defaults-merge path (Exoplanet.Filters.merge/2); nil values
    in default_filters keep the library default in both entry points.
  • Exoplanet.DateTimeParser.parse/1 now always returns
    {:ok, NaiveDateTime.t()} or a two-element {:error, reason} tuple
    (it previously leaked NimbleParsec's six-element error tuple).

Deprecated

  • The application env key for extra Req options is now :req_options.
    The old :planet_req_options key keeps working as a deprecated fallback
    and logs a one-time deprecation warning — rename it to :req_options
    (config :exoplanet, req_options: [...]).

Fixed

  • A single slow feed no longer crashes the entire build. Exoplanet.build/1
    now kills tasks that exceed feed_timeout (plus a 1s grace period) and
    drops only that feed, logging a warning that names the feed URL.
  • Exoplanet.DateTimeParser no longer corrupts pre-2000 RFC 822 dates.
    Four-digit years pass through unchanged (1999 used to become 3999), and
    two-digit years follow the RFC 2822 century rule: 00-49 → 2000s, 50-99 →
    1900s ("99" used to become 2099).
  • Exoplanet.Parser now ensures the cache adapter module is loaded before
    probing for the optional on_success/on_error callbacks, so they are no
    longer silently skipped in interactive/dev environments.
  • RSS/Atom detection now inspects only the feed's root element instead of
    scanning the whole body for <rss/<rdf:RDF. An Atom feed that merely
    mentions those strings inside an entry's content is no longer misparsed
    as RSS.

Security

  • The default HTML sanitizer (sanitize_html: true) now also removes on*
    event-handler attributes and URL-bearing attributes (href, src,
    srcset, action, formaction, poster, xlink:href) whose URL
    scheme is not http, https, or mailto (relative URLs are kept).
    Previously javascript: links and inline event handlers passed through.
  • The default drop_tags now also drops the SVG SMIL animation elements
    animate, set, animateTransform, and animateMotion. These can
    animate an ancestor <a>'s href to a javascript: URL via their
    to/values/from/by attributes — attribute names the URL-scheme
    allowlist does not cover — so the payload previously survived
    sanitization. Inline <svg> images are unaffected. Configs that set
    drop_tags explicitly should add these four element names.