2

I'm trying to create an endpoint out of a base64 string, but only end up with a 403 forbidden error when used. My first though is that there is a limit on how long a url can be?

EDIT

It seems after some exploration the MAX the string can be is 255 characters, after that it blows up??

Here is my Route setup

....
Route::get('/{glob}', 'GrantController@Init');
....

Here is my GrantController

Class GrantController Extends BaseController
{
    protected   $str  = null,
                $obj  = null;

    /**
     * Run the trap..
     *
     * @param $data
     * @return mixed
     */
    public function init($data)
    {
        return \View::make('debug.dump', [
                'data' => $data
        ]);
    }
}

And /Views/debug/dump.php

echo $data . '<br />';
echo 'Length: ' . strlen($data); // 255 MAX
ehime
  • 8,025
  • 14
  • 51
  • 110
  • 1
    ["Servers ought to be cautious about depending on URI lengths above 255 bytes"](http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.2.1) .. though you'd expect a 414 in response – msturdy Jul 30 '14 at 18:34
  • I would also first assume the server, but could be a soft limit of laravel. – twicejr Jul 30 '14 at 21:35

1 Answers1

1

Just a precision on msturdy comment, the URI RFC explain the design of any uri:

URI producers should use names that conform to the DNS syntax, even when use of DNS is not immediately apparent, and should limit these names to no more than 255 characters in length.

RFC3986 - URI

Community
  • 1
  • 1
Thomas Dutrion
  • 1,844
  • 1
  • 11
  • 9
  • 3
    Would be very strict of Laravel though. I think the user decides. The browser and subsystems may pose the limits though: see http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers – twicejr Jul 30 '14 at 21:35
  • Could also come from the server itself... ehime are you using a proper server (apache/nginx) or are you using php -S / artisan serve? – Thomas Dutrion Jul 30 '14 at 21:38
  • As I understand it, Laravel's routing and request handling is based heavily on Symfony, and I can't see that Symfony limits the length of the request anywhere... – msturdy Jul 30 '14 at 22:51