diff --git a/CHANGELOG.md b/CHANGELOG.md index 1186d0d..4a4e884 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ Solverr follows its own [Semantic Versioning](https://semver.org/), starting at ## [Unreleased] +### Fixes + +- **Form POST requests from Prowlarr work again, instead of failing with "Request parameter 'headers' must be a list".** 1.6.0 started checking the type of the deprecated `headers` field, which Solverr has never read and which clients send as an object; it is accepted in any shape again and still ignored. + ## [1.6.0] ### Additions diff --git a/src/dtos.py b/src/dtos.py index 3e20d83..8dbc613 100644 --- a/src/dtos.py +++ b/src/dtos.py @@ -77,6 +77,12 @@ def __init__(self, _dict): 'maxTimeout': None, # A fractional wait is meaningful and both engines sleep on it happily. 'waitInSeconds': (int, float), + # Deprecated in FlareSolverr v2 and never read by Solverr; upstream + # FlareSolverr only warns and ignores it. Legacy clients such as Prowlarr + # still send an object here (its HeadersPost), which the `list` annotation + # above would reject outright. Exempt it rather than break a client that + # isn't wrong. + 'headers': None, } _TYPE_NAMES = { diff --git a/src/test_request_validation.py b/src/test_request_validation.py index be4dc7b..b4b1a32 100644 --- a/src/test_request_validation.py +++ b/src/test_request_validation.py @@ -218,6 +218,10 @@ def test_a_boolean_is_not_accepted_as_a_number(self): with self.assertRaises(Exception): self.check(tabs_till_verify=True) + def test_the_deprecated_headers_object_is_accepted(self): + # Prowlarr's form POST sends this shape; the field is never read. + self.assertIsNone(self.check(headers={"contentType": "application/x-www-form-urlencoded"})) + def test_a_numeric_max_timeout_string_is_left_to_its_own_validator(self): # Deliberately coerced rather than type-checked, for callers that work today. self.assertIsNone(self.check(maxTimeout="90000"))