This is one approach that would resolve #35897.
Being able to request stale block headers is useful for clients that want to learn the ancestors of a blockhash e.g. when following a re-org up and matches the functionality of the getblockheader RPC.
This branch takes the approach that a user has to set count=1 and opt-in to non-active-chain blocks with activechainonly=false.
Alternative approaches:
Fetching stale blocks when count=1 without a new param
Hyrum's Law suggests that a client out there relies on the property that /headers/ returns [] for non-active-chain blocks, so this is probably dangerous.
A separate /header/ interface
This is nice because it avoids the parameter matrix, and we can have a REST path that matches the semantics of getblockheader, but I am not sure if this is worth the additional implementation complexity, but I could rework towards this approach if others feel strongly.
Another rest endpoint that supports negative ranges
e.g. see #33752
LLM Disclosure: Used as a research tool and rubber ducky while making this PR, but all code and text came from some indeterminate place inside my body.