Skip to content

Instantly share code, notes, and snippets.

@vanthao03596
vanthao03596 / Middleware-CSP.php
Created May 3, 2023 04:30 — forked from valorin/.env.example
CSP Middleware - the simple CSP middleware I use across all of my projects.
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Support\Facades\Vite;
use Illuminate\Support\Str;
/**
* Simple Content Security Policy middleware.
"use client";
import { App as AntdApp, ConfigProvider, theme, ThemeConfig } from "antd";
import Cookies from "js-cookie";
import React, {
type PropsWithChildren,
createContext,
useEffect,
useState,
} from "react";