3 years ago

Https problems with routes

Posted 3 years ago by eriktobben


So I've been working on a very simple API and I have been testing it for a while with no SSL-certificate. After I installed a Let's Encrypt certificate through Forge I get a strange error.

My routes look look like this:

Route::get('email', '[email protected]')->name('email.index');
Route::post('email/send', '[email protected]')->name('email.send');
Route::get('email/{id}', '[email protected]')->name('');

On all routes I have a Token validation that gets passed as a header on the GET-routes and as part of the request body on the POST-route.

Problem: If I send a POST request to I expect to get a response back with the email ID but instead I get a token validation error. After some testing I find that this particular message gets generated by [email protected] That was not the case before I added SSL. If I test the same route in Homestead everything works great.

If I do the same request to everything works as expected.

I find it strange that adding a SSL-certificate will change how the server handles the POST request and sends is to a route that is only defined as GET. There have been no changes to the code and the same code is working fine in Homestead (without SSL)

Please sign in or create an account to participate in this conversation.