8000 Issue accessing API routes over HTTPS · Issue #6 · dingo/api · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Issue accessing API routes over HTTPS #6
Closed
@mrtimp

Description

@mrtimp

I had an issue where it looked like Laravel was throwing a NotFoundHttpException exception and Dingo was returning a JSON document like:

{
"message": "404 Not Found"
}

When accessing API routes over HTTPS. I took the default code from the Dingo documentation (and excluded the Post route as I didn't have that in my application):

Route::api(['version' => 'v1'], function()
{
Route::get('users', function()
{
return User::all();
});
});

and when I was calling https://myproject/users I was getting the above error.

What is somewhat more confusing is when I reconfigured the route to:

Route::group([ 'version' => 'v1' ], function() {
{
Route::get('users', function()
{
return User::all();
});
});

I didn't get any error. I did some more investigation and I found a similar issue on the Laravel IO forums:

http://laravel.io/forum/03-21-2014-https-definition-in-routesphp

this forum post indicated someone had had similar issues when accessing standard routes over HTTPS. My use case was slightly different as I was using Apache 2.2 rather than Nginx but when I followed their instructions and adjusted the Laravel Illuminate\Routing\Route::httpOnly method I could access my route via Route::api and standard Route::groups.

I'm really not sure if this is a Dingo or a Laravel issue.

Any suggestions would be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0