Skip to content

Make Vite::isRunningHot public - #44900

Merged
taylorotwell merged 1 commit into
laravel:9.xfrom
liamkeily:refactor/vite-public-is-hot-running
Nov 10, 2022
Merged

Make Vite::isRunningHot public#44900
taylorotwell merged 1 commit into
laravel:9.xfrom
liamkeily:refactor/vite-public-is-hot-running

Conversation

@liamkeily

@liamkeily liamkeily commented Nov 10, 2022

Copy link
Copy Markdown
Contributor

I am currently getting a lot of Content Security Policy errors when the Vite HMR server is running. It would be nice to be able to disable CSP rules when it is running. For example:

   public function shouldBeApplied(Request $request, Response $response): bool
    {
        if (Vite::isRunningHot()) {
            return false;
        }

        return parent::shouldBeApplied($request, $response);
    }

is_file(Vite::hotFile()) can be called to achieve this, but it would be nicer if this method was public

@liamkeily liamkeily changed the title Make isHotRunning public Make isRunningHot public Nov 10, 2022
@liamkeily liamkeily changed the title Make isRunningHot public Make Vite::isRunningHot public Nov 10, 2022
@taylorotwell
taylorotwell merged commit ea88e2e into laravel:9.x Nov 10, 2022
@liamkeily
liamkeily deleted the refactor/vite-public-is-hot-running branch November 16, 2022 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants