Open sanderha opened 5 years ago
Hi @sanderha, I can't reproduce this issue. I'm using recipe-cms 4.4.1, php 7.1 and 2.1.2.
You can see that RestfulServer.allowed_actions
defines notFound
as an allowed action:
private static $allowed_actions = array(
'index',
'notFound'
);
Admittedly, I'm not getting the "That object wasn't found" response from /api/v1
, but I am getting a 404 page.
Test steps:
composer create-project silverstripe/recipe-cms ./restfulserver78 4.4.1
cd restfulserver78 && composer require silverstripe/restfulserver
private static $api_access = true
in Page
/api/v1
- returns "Page not found"/api/v1/Page
- returns Page informationAre you able to provide more information to help?
Hmm I can see that my CMS has not generated the 404 page for some reason.. Maybe thats why I'm seting the Action 'notFound' isn't available
message, because the response is a 404 correctly.
And you probably did have the 404 error page in the CMS, so thats why you got that displayed when vising /api/v1
.
I will try to debug some more to see whats wrong
Yeah that could be it. The core indicates that it expects to handle its own 404 response, so perhaps the bug is that it’s not doing so
Accessing the root
/api/v1
gives this error in dev mode:Havent looked into the issue yet.
Using recipe-cms ^4.3, php 7.3 and ^2.1 of this module