livecheck/strategy/extract_plist: enable livecheck url options by bevanjkay · Pull Request #21335 · Homebrew/brew

AI review requested due to automatic review settings

December 29, 2025 13:02

@bevanjkay

samford

@samford

The previous commit intended to update the `ExtractPlist` strategy to
also use `url` options from `livecheck` blocks when they're supported
by `Cask::URL` (i.e., same keyword parameter name). However, due to
the `next unless cask_copy.url.specs.key?(options_key)` guard,
only the `user_agent` option worked because the `specs` hash includes
a `user_agent` value by default. The prior `cask_copy.url url` call
resets the `specs` hash to the default values, so options like
`referer` were skipped even if the existing cask `url` had the same
argument.

This addresses the issue by collecting the keyword parameters of the
`Cask::URL.initialize` method and comparing `livecheck` block `url`
options to those names instead. This ensures that supported values
will be used regardless of whether the existing cask `url` uses the
same argument. Collecting keyword arguments also allows us to pass the
values as arguments to the `cask_copy.url` call instead of setting
`specs` values directly. Lastly, this addresses an issue in the
previous approach where the `initialize` method used a `header`
keyword parameter but the related specs key is `headers`.

Besides that, this also uses `Options#url_options` instead of
`Options#to_h`, as it will avoid unrelated options in the future
(saving a little unnecessary work).

nandahkrishna

@samford samford deleted the extractplist-url-options branch

January 26, 2026 22:46