![]() |
Hi
I've defined a new route as Code: $routes->get('/opendata/(:segment)', 'Tools::openData/$1'); This Tools/openData controller/fuction receives 1 parameter, which is a base64 encoded string of about (average) 500 characters I've tried with Code: https://myApp.com/opendata/dGhpc2lzanVzdGF0ZXN0dGhpc2lzanVzdGF0ZXN0dGhpc2lzanVzdGF0ZXN0dGhpc2lzanVzdGF0ZXN0dGhpc2lzanVzdGF0ZXN0dGhpc2lzanVzdGF0ZXN0 Now, I've tried with a real world example which is about 500 char. long and I get a 404 error 1. Any workaround or config setting to allow this ? 2. Any function that could shorten/compress this string (without database, cookies, etc.) univocally so it can work without modifying anything else? Thanks a lot
Enrique
https://beza.com.ar
All work.
Code: CodeIgniter\HTTP\IncomingRequest {#20 ▼
What ?
Don't you get 404 when throwing segments of 500 char long? Ouch .. then how could I debug the 404 error I'm getting? I've enabled debug, debugbar etc. but cannot get anything useful about the 404 it is throwing Also, the apache server has no extra config or anything weird about it. Same with PHP. Both std installations Thanks again
Enrique
https://beza.com.ar
Base64 string can contain "/". If your string contains "/", it is not a single segment.
Try "(:any)". But a controller parameter only gets one segment. You need to use "...$params" to get multiple segments. Code: Maximum URL length for web servers and CDNs What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(09-07-2023, 02:53 PM)kenjis Wrote: Base64 string can contain "/". If your string contains "/", it is not a single segment. Wow, you're right. That was it. I've found a / in the 500char string I've found these functions on internet that seems to work and handle the / = chars Code: Thanks again (09-07-2023, 10:43 PM)InsiteFX Wrote: Thanks a lot 4 the useful info
Enrique
https://beza.com.ar
Try using urlencode.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(09-08-2023, 09:07 PM)InsiteFX Wrote: Try using urlencode. added urlencode in the above shared functions and working great! Thanks
Enrique
https://beza.com.ar |
Welcome Guest, Not a member yet? Register Sign In |