spooder 6.1.3 → 6.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/api.ts +5 -1
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "spooder",
3
3
  "author": "Kruithne <kruithne@gmail.com>",
4
4
  "type": "module",
5
- "version": "6.1.3",
5
+ "version": "6.1.4",
6
6
  "module": "./src/api.ts",
7
7
  "bin": {
8
8
  "spooder": "./src/cli.ts"
package/src/api.ts CHANGED
@@ -1147,7 +1147,11 @@ export function git_get_hashes_sync(length = 7): Record<string, string> {
1147
1147
  const cookie_map = new WeakMap<Request, Bun.CookieMap>();
1148
1148
 
1149
1149
  export function cookies_get(req: Request): Bun.CookieMap {
1150
- const jar = new Bun.CookieMap(req.headers.get('Cookie') ?? undefined);
1150
+ let jar = cookie_map.get(req);
1151
+ if (jar !== undefined)
1152
+ return jar;
1153
+
1154
+ jar = new Bun.CookieMap(req.headers.get('Cookie') ?? undefined);
1151
1155
  cookie_map.set(req, jar);
1152
1156
  return jar;
1153
1157
  }