alexdebril / feed-io

A PHP library to read and write feeds in JSONFeed, RSS or Atom format
https://alexdebril.github.io/feed-io/
MIT License
255 stars 53 forks source link

"internal server error" message on requests not returning 500 status code #415

Open ABouchard55 opened 1 year ago

ABouchard55 commented 1 year ago

I've been fighting we a particular RSS Feed platform returning an "internal server error" message from an exception.

After commenting every try/catch I could find in the stack, I finally had the message from Guzzle saying "405: Method not allowed". Turns out, this provider doesn't accept HEAD requests.

So first thing, "internal server error", the message for a ServerErrorException, sent in HTTP/Client, should not be the default case.

Also, I don't seem to be able to avoid using the HEAD method method in the Reader class, $modifiedSince is forced to be defined and will trigger a HEAD request in Http/Client::getResponse();

alexdebril commented 1 year ago

You can inject your own HTTP reader to feed-io when building its main object. That way, you can define the error management and the headers sent through each query.