Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Vite::isRunningHot public #44900

Merged
merged 1 commit into from
Nov 10, 2022
Merged

Make Vite::isRunningHot public #44900

merged 1 commit into from
Nov 10, 2022

Conversation

liamkeily
Copy link
Contributor

@liamkeily liamkeily commented Nov 10, 2022

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