ingeniasoftware / luthier-ci

Improved routing, middleware support, authentication tools and more for CodeIgniter 3 framework
https://luthier.ingenia.me/ci/en/
MIT License
150 stars 38 forks source link

routes in api.php only works when ajax request is made by jquery #44

Closed amargoCactus closed 3 years ago

amargoCactus commented 4 years ago

When i try to make an ajax request with axios or fetch api gives a 404 error

tepeumut commented 4 years ago

Did you write request route into api.php?

andersonsalas commented 4 years ago

Hi @s9ul3ss!

In adition to @tepeumut suggest, can you verify that the HTTP_X_REQUESTED_WITH HTTP header is sent with the value xmlhttprequest?

amargoCactus commented 4 years ago

Hello. I wrote it in api.php

amargoCactus commented 4 years ago

I tried to send the X-Requested-With header with the value XMLHttpRequest in axios and it worked but in fetch api it didn't

amargoCactus commented 4 years ago

in fetch api gives a 200 but doesn't show the json in the response

andersonsalas commented 4 years ago

Can you share both your route php code and the javascript code please?

oterminramiro commented 4 years ago

This worked for me, just go to system/core/input.php and comment line 836 and write return true.

jalidchaer commented 3 years ago

cuando intento hacer una solicitud ajax me esta generando el error 503 en mi servidor de producción, solamente el error ocurre desde que empecé a usar Luthier CI, al desactivar el plugin funciona sin problemas hay alguna configuración adicional que se debe realizar?

jalidchaer commented 3 years ago

When I try to make an ajax request it is generating 503 error on my production server, only the error occurs since I started using Luthier CI, when deactivating the plugin it works without problems, is there any additional configuration that must be done?

andersonsalas commented 3 years ago

Hi @jalidchaer, thanks for using Luthier CI.

Please provide more information in order to help you with your issue. 5xx errors are server-related and can occur by many causes such bad server configuration, syntax errors, out of memory, etc.

If you are using apache, try to find the error.log file in your hosting file system and open a new issue with the related stack trace.

jalidchaer commented 3 years ago

Hi @andersonsalas, Thanks for your answer, the 503 error occurs in ajax requests, as far as I could it is due to a problem in the memory limit, is there any memory or resource limit that must be configured on the server for the use of the plugin?

andersonsalas commented 3 years ago

PHP execution and memory limits can be configured with memory_limit and max_execution_time php.ini directives. However, keep in mind that those directives may be locked/disabled on shared hostings, so I'm assuming that you're using a VPS/dedicated server for your application.

PS: I'm locking this issue because is too old. Please feel free to open another one if you need more assistance.