laravel / nova-issues

556 stars 34 forks source link

Empty NOVA_PATH should be handled #6449

Closed AbdelkaderBah closed 5 months ago

AbdelkaderBah commented 5 months ago

Description:

First it might sound stupid to have NOVA_PATH empty, I have just git pulled, and copied .env.example to .env set few environments and forgot NOVA_PATH and I got 500 server error, after digging I found that it's because NOVA_PATH is null.

When an empty NOVA_PATH is provided, Nova should thrown an exception with meaningful error message .

Currently it gives:

Trying to access array offset on value of type bool

That's because Laravel\Nova\Util tries to access isset($uri['port']) on line 34

Detailed steps to reproduce the issue on a fresh Nova installation:

  1. Set environment
    NOVA_PATH=
  2. Access your app / url.
crynobone commented 5 months ago

Use NOVA_PATH=/

AbdelkaderBah commented 5 months ago

Actually I am leaving it to NOVA_PATH= on purpose,

  1. The admin path is a secret path that only internals knows about
  2. If it is empty the admin should not be accessible