Skip to content

Commit dc3ab09

Browse files
Merge pull request #31 from workleap/chore/remove-nanoid
chore: remove nanoid
2 parents 1681e05 + 2acbca7 commit dc3ab09

File tree

5 files changed

+8
-15
lines changed

5 files changed

+8
-15
lines changed

.changeset/long-spies-cut.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@workleap/netlify-skew-protection": major
3+
---
4+
5+
Removing nanoid and first major release.

lib/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
"test": "vitest --config vitest.config.ts --no-watch"
3232
},
3333
"dependencies": {
34-
"@netlify/edge-functions": "^2.12.0",
35-
"nanoid": "^5.1.5"
34+
"@netlify/edge-functions": "^2.12.0"
3635
},
3736
"devDependencies": {
3837
"@rslib/core": "0.6.9",

lib/src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Original Gist provided by Netlify: https://gist.github.com/sean-roberts/cbf1e9197e37e8dcd22c4f058ad86448.
22

33
import type { Config, Context } from "@netlify/edge-functions";
4-
import { nanoid } from "nanoid";
54

65
export const SecretEnvironmentVariable = "SKEW_PROTECTION_SECRET";
76
export const CookieName = "nf_sp";
@@ -126,7 +125,7 @@ export function createSkewProtectionFunction(mode: Mode, options: CreateSkewProt
126125

127126
return async (request: Request, context: Context) => {
128127
try {
129-
const logDebug = createLogFunction(nanoid(7), verbose);
128+
const logDebug = createLogFunction(crypto.randomUUID(), verbose);
130129

131130
if (!context.deploy || !context.deploy.id || !context.deploy.published) {
132131
logDebug("This is dev mode, exiting.");

pnpm-lock.yaml

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/manifest/netlify/edge-functions/skew-protection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { config, createSkewProtectionFunction } from "@workleap/netlify-skew-protection";
22

33
const fct = createSkewProtectionFunction("entrypoints", {
4-
entrypoints: ["/"],
4+
entrypoints: ["/", "/manifest.json"],
55
verbose: true
66
});
77

0 commit comments

Comments
 (0)