Rss-Bridge/lib
LogMANOriginal b90bcee1fc
Return exceptions in requested feed formats (#841)
* [Exceptions] Don't return header for bridge exceptions
* [Exceptions] Add link to list in exception message

This is an alternative when the button is not rendered
for some reason.

* [index] Don't return bridge exception for formats
* [index] Return feed item for bridge exceptions
* [BridgeAbstract] Rename 'getCacheTime' to 'getModifiedTime'
* [BridgeAbstract] Move caching to index.php to separate concerns

index.php needs more control over caching behavior in order to cache
exceptions. This cannot be done in a bridge, as the bridge might be
broken, thus preventing caching from working.

This also (and more importantly) separates concerns. The bridge should
not even care if caching is involved or not. Its purpose is to collect
and provide data.

Response times should be faster, as more complex bridge functions like
'setDatas' (evaluates all input parameters to predict the current
context) and 'collectData' (collects data from sites) can be skipped
entirely.

Notice: In its current form, index.php takes care of caching. This
could, however, be moved into a separate class (i.e. CacheAbstract)
in order to make implementation details cache specific.

* [index] Add '_error_time' parameter to $item['uri']

This ensures that error messages are recognized by feed readers as
new errors after 24 hours. During that time the same item is returned
no matter how often the cache is cleared.

References https://github.com/RSS-Bridge/rss-bridge/issues/814#issuecomment-420876162

* [index] Include '_error_time' in the title for errors

This prevents feed readers from "updating" feeds based on the title

* [index] Handle "HTTP_IF_MODIFIED_SINCE" client requests

Implementation is based on `BridgeAbstract::dieIfNotModified()`,
introduced in 422c125d8e and
simplified based on https://stackoverflow.com/a/10847262

Basically, before returning cached data we check if the client send
the "HTTP_IF_MODIFIED_SINCE" header. If the modification time is
more recent or equal to the cache time, we reply with "HTTP/1.1 304
 Not Modified" (same as before). Otherwise send the cached data.

* [index] Don't encode exception message with `htmlspecialchars`
* [Exceptions] Include error message in exception
* [index] Show different error message for error code 0
2018-10-15 17:21:43 +02:00
..
Authentication.php Add basic authentication support (#728) 2018-06-27 19:09:41 +02:00
Bridge.php [Bridge] Remove superfuous variables and statements 2017-08-06 00:04:07 +02:00
BridgeAbstract.php Return exceptions in requested feed formats (#841) 2018-10-15 17:21:43 +02:00
BridgeCard.php CSS adjustments to improve readability for bridge parameters (#763) 2018-09-15 16:39:50 +02:00
BridgeInterface.php Return exceptions in requested feed formats (#841) 2018-10-15 17:21:43 +02:00
BridgeList.php Catching up | [Main] Debug mode, parse utils, MIME | [Bridges] Add/Improve 20 bridges (#802) 2018-09-09 20:20:13 +01:00
Cache.php [phpcs] Add missing rules 2017-07-29 19:55:12 +02:00
CacheInterface.php [cache] Specify cache duration for 'purgeCache' 2016-10-08 16:18:10 +02:00
Configuration.php Add 'dev.' to the release version in master 2018-09-26 20:04:27 +02:00
contents.php [contents] Return error if the server responded with any code other than 200 2018-09-26 19:16:02 +02:00
error.php Catching up | [Main] Debug mode, parse utils, MIME | [Bridges] Add/Improve 20 bridges (#802) 2018-09-09 20:20:13 +01:00
Exceptions.php Return exceptions in requested feed formats (#841) 2018-10-15 17:21:43 +02:00
FeedExpander.php Catching up | [Main] Debug mode, parse utils, MIME | [Bridges] Add/Improve 20 bridges (#802) 2018-09-09 20:20:13 +01:00
Format.php [phpcs] Add missing rules 2017-07-29 19:55:12 +02:00
FormatAbstract.php [core] Returning 304 http code when returning cached data (#793) 2018-08-25 20:00:38 +01:00
FormatInterface.php [FormatInterface] Add missing public functions 2016-11-09 18:41:24 +01:00
html.php Catching up | [Main] Debug mode, parse utils, MIME | [Bridges] Add/Improve 20 bridges (#802) 2018-09-09 20:20:13 +01:00
ParameterValidator.php [ParameterValidator] Move 'getQueriedContext' from BridgeAbstract 2018-09-22 17:04:55 +02:00
RssBridge.php [ParameterValidator] Refactor 'validation' into 'ParameterValidator' 2018-09-22 16:42:04 +02:00