diff options
author | 2024-02-26 13:43:20 +0000 | |
---|---|---|
committer | 2024-02-26 19:13:20 +0530 | |
commit | f5acd5d40da2a6d8bd539b9a601083a56dc4d5db (patch) | |
tree | 1d98f50dd0a2b804293fc1b9d908163d83f9a304 /packages/integrations/netlify/src | |
parent | 768ef569a34f4e6e2e12df8946ee861823d0685e (diff) | |
download | astro-f5acd5d40da2a6d8bd539b9a601083a56dc4d5db.tar.gz astro-f5acd5d40da2a6d8bd539b9a601083a56dc4d5db.tar.zst astro-f5acd5d40da2a6d8bd539b9a601083a56dc4d5db.zip |
fix(netlify): replace `global.crypto` with `crypto` (#163)
* Use `crypto` package instead of `global.crypto`
* Create young-ravens-hammer.md
* Apply suggestions from code review
---------
Co-authored-by: Alexander Niebuhr <alexander@nbhr.io>
Co-authored-by: Arsh <69170106+lilnasy@users.noreply.github.com>
Diffstat (limited to 'packages/integrations/netlify/src')
-rw-r--r-- | packages/integrations/netlify/src/index.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/integrations/netlify/src/index.ts b/packages/integrations/netlify/src/index.ts index 71942c6a1..be9a5b88f 100644 --- a/packages/integrations/netlify/src/index.ts +++ b/packages/integrations/netlify/src/index.ts @@ -6,6 +6,7 @@ import type { AstroConfig, AstroIntegration, RouteData } from 'astro'; import { AstroError } from 'astro/errors'; import { build } from 'esbuild'; import { appendFile, mkdir, readFile, rm, writeFile } from 'fs/promises'; +import { randomUUID } from 'crypto' import type { Args } from './ssr-function.js'; const { version: packageVersion } = JSON.parse( @@ -77,7 +78,7 @@ export default function netlifyIntegration( let rootDir: URL; let astroMiddlewareEntryPoint: URL | undefined = undefined; // Secret used to verify that the caller is the astro-generated edge middleware and not a third-party - const middlewareSecret = crypto.randomUUID(); + const middlewareSecret = randomUUID(); const ssrOutputDir = () => new URL('./.netlify/functions-internal/ssr/', rootDir); const middlewareOutputDir = () => new URL('.netlify/edge-functions/middleware/', rootDir); |