Open gjimish opened 1 year ago
By allowing a PSR-18 HTTP client the headers could be changed easily. See #777 and #826.
I am not sure changing headers is a meaningful operation. SimplePie can make multiple HTTP requests and you probably do not want to set a single Accept
header for all of them.
Supplying a custom PSR-18 client with middleware that adjusts headers per request will be probably a better idea. And you do not need to wait for PSR-18 support, you can pass a custom client, that does whatever with headers, today. We do that in selfoss: https://github.com/fossar/selfoss/blob/c49337513662e772c52235f3617f98a13071cdac/src/helpers/FeedReader.php#L33
Is your feature request related to a problem? Please describe.
Allow to pass other headers as well for feed url.
Describe the solution you'd like
https://github.com/simplepie/simplepie/blob/adc91d455d2247ad4eb9febef0c275a780780cad/src/SimplePie.php#L1732-L1734 should be configurable.
Describe alternatives you've considered
N/A
Additional context
I can submit a PR.