Headlines crashes after opens when getting html response instead of json
Hi, I have been testing a newly packaged Headlines for the NixOS ecosystem. After solving all the dependencies requirements the app still crashes. I did a little debugging and it crashes here:
https://gitlab.com/caveman250/Headlines/-/blob/master/src/util/Helpers.cpp#L49
When it tries to parse the following data as JSON
<html>
<head>
<title>302 Found</title>
</head>
<body>
<h1>302 Found</h1>
The resource was found at <a href="https://www.reddit.com/login/.api?dest=https%3A%2F%2Fapi.reddit.com%2Fmessage%2Funread.api">https://www.reddit.com/login/.api?dest=https%3A%2F%2Fapi.reddit.com%2Fmessage%2Funread.api</a>;
you should be redirected automatically.
</body>
</html>
I got the information by using the following line (printing out str.data()):
g_warning("Json::CharReader error: %s, %s", errs.c_str(), str.data());
I can say for sure that I have never logged in in the app (have been testing it for 2-3 days).
Full output from the console (including the added str.data()):
headlines
** (process:1986900): WARNING **: 19:41:40.177: Can't set the global locale to the user's preferred locale.
locale::facet::_S_create_c_locale name not valid
The environment variable LANG may be wrong.
(process:1986900): Gtk-WARNING **: 19:41:40.179: Locale not supported by C library.
Using the fallback 'C' locale.
** (headlines:1986900): WARNING **: 19:41:40.452: Json::CharReader error: * Line 1, Column 1
Syntax error: value, object or array expected.
, \xa1\u001f=\xb0\u007f
fish: Job 1, 'headlines' terminated by signal SIGSEGV (Address boundary error)
daniel@tuxedo ~/d/MARKUS SCHULZ - Without You Near (2005) [SIGSEGV]> headlines
** (process:2008537): WARNING **: 19:44:47.867: Can't set the global locale to the user's preferred locale.
locale::facet::_S_create_c_locale name not valid
The environment variable LANG may be wrong.
(process:2008537): Gtk-WARNING **: 19:44:47.869: Locale not supported by C library.
Using the fallback 'C' locale.
** (headlines:2008537): WARNING **: 19:44:48.097: Json::CharReader error: * Line 1, Column 1
Syntax error: value, object or array expected.
, <html>
<head>
<title>302 Found</title>
</head>
<body>
<h1>302 Found</h1>
The resource was found at <a href="https://www.reddit.com/login/.api?dest=https%3A%2F%2Fapi.reddit.com%2Fmessage%2Funread.api">https://www.reddit.com/login/.api?dest=https%3A%2F%2Fapi.reddit.com%2Fmessage%2Funread.api</a>;
you should be redirected automatically.
</body>
</html>
fish: Job 1, 'headlines' terminated by signal SIGSEGV (Address boundary error)