Commit 8d101166 authored by Maik Messerschmidt's avatar Maik Messerschmidt
Browse files

Fixed a few corner cases around 'null'.

parent 4507c21c
......@@ -64,11 +64,16 @@ class InputController extends Controller
public function show(Input $input) {
$json = json_decode($input->data);
if ($json === null)
// Funny thing: 'null' decodes to null just as any invalid json...
// Another funny thing: response()->json(null) will return '{}'...
// (Because php can't see, whether the parameter was provided or not...)
if ($input->data === 'null') {
return response($input->data)->header('Content-Type', 'application/json');
}
else if ($json === null)
return $input->data;
else
return response()->json($json);
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment