mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix graph output base64 (#14701)
Mostly for people using unauth graphs instead of the api.
This commit is contained in:
@@ -4,7 +4,6 @@ namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use LibreNMS\Config;
|
||||
use LibreNMS\Enum\ImageFormat;
|
||||
use LibreNMS\Exceptions\RrdGraphException;
|
||||
use LibreNMS\Util\Debug;
|
||||
@@ -19,7 +18,6 @@ class GraphController extends Controller
|
||||
public function __invoke(Request $request, string $path = ''): Response
|
||||
{
|
||||
$vars = array_merge(Url::parseLegacyPathVars($request->path()), $request->except(['username', 'password']));
|
||||
$output = $vars['graph_type'] ?? Config::get('webui.graph_type', 'default');
|
||||
|
||||
if (\Auth::check()) {
|
||||
// only allow debug for logged in users
|
||||
@@ -37,8 +35,8 @@ class GraphController extends Controller
|
||||
'Content-type' => $graph->contentType(),
|
||||
];
|
||||
|
||||
if ($output == 'base64') {
|
||||
return response($graph, 200, $headers);
|
||||
if ($request->get('output') == 'base64') {
|
||||
return response($graph->base64(), 200, $headers);
|
||||
}
|
||||
|
||||
return response($graph->data, 200, $headers);
|
||||
|
Reference in New Issue
Block a user