Files
duplicati/Duplicati/Library/Backend/OAuthHelper
Kenneth Skovhede 2f1f5bb7e0 The purpose of this update is to provide better error messages from servers that return error messages, but are expected to return JSON data.
In the current setup, the response stream is parsed by the JSON decoder, which throws an exception due to reading a non-json formatted error message.
The reported exception simply states that the first character on the first line was not valid json, which is true, but does not help diagnose the problem.

In many cases this is a human readable message, such as "over quota", "permission denied", etc.
This update adds a stream that keeps the first 2kb of the response in an internal buffer, which can then be printed in case the JSON parsing fails.
Most of the added code is just simple redirects for calling the base stream in the peeking stream.
2020-05-10 14:14:35 +02:00
..