laravel / valet

A more enjoyable local development experience for Mac.
https://laravel.com/docs/valet
MIT License
2.52k stars 696 forks source link

Bug passing IP as a param. #188

Closed streetgt closed 8 years ago

streetgt commented 8 years ago

Hello there, I found a bug where if you pass an IP as param the Valet just crashes.

Route::get('{ip}/banner', 'ServerController@banner')->name('banner'); Example: http://laravel.dev/46.101.1.92:4499/stats/

Perhaps it's not allowed to use a colon in parameters?

<b>Notice</b>:  Undefined index: extension in <b>/Users/tiagocardoso/.composer/vendor/laravel/valet/cli/drivers/ValetDriver.php</b> on line <b>122</b><br />

Greetings, Tiago

adamwathan commented 8 years ago

Hey Tiago thanks for the report, can you push up an open source Laravel repo that replicates the issue so I can pull it down to troubleshoot? Just something with the minimal route setup necessary to recreate the problem.

Thanks! On Sun, Oct 9, 2016 at 5:58 PM Tiago Cardoso notifications@github.com wrote:

Hello there, I found a bug where if you pass an IP as param the Valet just crashes.

Route::get('{ip}/banner', 'ServerController@banner')->name('banner'); Example: http://laravel.dev/46.101.1.92:4499/stats/

Perhaps it's not allowed to use a colon in parameters?

Notice: Undefined index: extension in /Users/tiagocardoso/.composer/vendor/laravel/valet/cli/drivers/ValetDriver.php on line 122

Greetings, Tiago

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/laravel/valet/issues/188, or mute the thread https://github.com/notifications/unsubscribe-auth/AEH3bJOeCNS3wk--6KQjQy_Fvcj0ejlLks5qyWN3gaJpZM4KSIFw .

streetgt commented 8 years ago

Here we go :) https://github.com/tiagocardosoweb/colon-valet

adamwathan commented 8 years ago

Seems like the problem is that PHP's parse_url blows up in this case :/ Will have to think about how to get around this in a non-horrible way :(

adamwathan commented 8 years ago

Think this will fix it, try pulling down master and re-running valet install and seeing if you run into any other issues:

https://github.com/laravel/valet/commit/76c1fdb8c6e6daf3b261cb423ddae18b6fa82204

streetgt commented 8 years ago

It fixes the problem, but I hope it won't interfere with other stuff, maybe lets keep the issue open and see if other people run into another problem.

Thanks @adamwathan

adamwathan commented 8 years ago

Doing some clean up, gonna close this one as resolved.