Skip to content

v3.0:

Latest

Choose a tag to compare

@snarfed snarfed released this 15 Oct 05:37
· 2 commits to main since this release
c1da07b

Breaking changes:

  • util:
    • Remove if_changed.
    • pretty_link: only link http and https URLs. For other URLs, return just the link text.

Non-breaking changes:

  • flask_util:
    • Add bool_param for getting boolean query params/form arguments.
    • Add csp_report handler for logging Content-Security-Policy violation reports.
    • MODERN_HEADERS: tighten Content-Security-Policy significantly.
  • models:
    • Fix missing import in Cache.get/Cache.put.
  • testutil:
    • Add assert_html_equals, which compares HTML strings and ignores insignificant whitespace and attribute order.
    • requests_response: back the returned response with a urllib3.HTTPResponse instead of a bare BytesIO, so that resp.raw.stream() works for code that streams responses.
  • util:
    • requests_*: add cache kwarg, an opt-in Flask-request-local cache of GET/HEAD responses and exceptions, keyed on method, URL, and Accept header.
    • encode: fix encoding kwarg, it was ignored for nested values and always used UTF-8.
    • is_connection_failure: make prawcore import optional.
    • linkify, tokenize_links: fix duplicated trailing punctuation after a link, eg http://foo.com/a).. became http://foo.com/a)..... .
    • clean_url: fix query params with escaped delimiters, eg ?a=b%26c lost the %26c. The query string was unescaped before it was parsed.
    • maybe_iso8601_to_rfc3339: return non-string inputs unchanged instead of raising AttributeError.
    • pretty_link: HTML-escape the URL in href and the attrs values.
    • to_utc_timestamp: fix timezone aware datetimes, they were read as wall clock time and their UTC offset was ignored.
    • trim_nulls: add keep_empty_values_in kwarg.