nuxt-og-image 6.7.3 → 6.7.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.
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "nuxt": ">=3.16.0"
5
5
  },
6
6
  "configKey": "ogImage",
7
- "version": "6.7.3",
7
+ "version": "6.7.4",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
@@ -1,5 +1,5 @@
1
1
  import { defu } from "defu";
2
- import { createError, getQuery } from "h3";
2
+ import { createError } from "h3";
3
3
  import { useNitroApp } from "nitropack/runtime";
4
4
  import { parseURL, withoutLeadingSlash, withoutTrailingSlash, withQuery } from "ufo";
5
5
  import { normalizeKey } from "unstorage";
@@ -12,6 +12,7 @@ import { hashKey } from "../../shared/hash.js";
12
12
  import { autoEjectCommunityTemplate } from "../util/auto-eject.js";
13
13
  import { createNitroRouteRuleMatcher } from "../util/kit.js";
14
14
  import { normaliseOptions } from "../util/options.js";
15
+ import { getEventQuery } from "../util/query.js";
15
16
  import { createTimings, TIMING_CTX_KEY } from "../util/timings.js";
16
17
  import { withTimeout } from "../util/withTimeout.js";
17
18
  import { useOgImageRuntimeConfig } from "../utils.js";
@@ -102,7 +103,7 @@ export async function resolveContext(e) {
102
103
  }
103
104
  let queryParams = {};
104
105
  if (import.meta.dev || import.meta.prerender) {
105
- const query = getQuery(e);
106
+ const query = getEventQuery(e);
106
107
  for (const k in query) {
107
108
  const v = String(query[k]);
108
109
  if (!v)
@@ -1,7 +1,8 @@
1
- import { createError, defineEventHandler, getQuery, getRequestHost, sendRedirect } from "h3";
1
+ import { createError, defineEventHandler, getRequestHost, sendRedirect } from "h3";
2
2
  import { parseURL, withLeadingSlash, withQuery } from "ufo";
3
3
  import { getSiteConfig } from "#site-config/server/composables/getSiteConfig";
4
4
  import { isInternalRoute } from "../../shared.js";
5
+ import { getEventQuery } from "../util/query.js";
5
6
  import { useOgImageRuntimeConfig } from "../utils.js";
6
7
  const RE_META_TAG = /<meta\b[^>]*>/gi;
7
8
  const RE_META_KEY = /\b(?:property|name)\s*=\s*(?:"([^"]+)"|'([^']+)')/i;
@@ -88,7 +89,7 @@ export default defineEventHandler(async (event) => {
88
89
  statusMessage: "[Nuxt OG Image] Cannot resolve og:image for internal route."
89
90
  });
90
91
  }
91
- const query = getQuery(event);
92
+ const query = getEventQuery(event);
92
93
  const ogKey = typeof query._og_key === "string" ? query._og_key.toLowerCase() : "";
93
94
  const metaKey = ogKey === "twitter" ? "twitter:image" : "og:image";
94
95
  const forwardQuery = {};
@@ -1,9 +1,10 @@
1
1
  import { fnv1a64Base36 } from "fnv1a-64";
2
- import { createError, getQuery, handleCacheHeaders, setHeader, setHeaders } from "h3";
2
+ import { createError, handleCacheHeaders, setHeader, setHeaders } from "h3";
3
3
  import { useStorage } from "nitropack/runtime";
4
4
  import { withTrailingSlash } from "ufo";
5
5
  import { prefixStorage } from "unstorage";
6
6
  import { logger } from "../../logger.js";
7
+ import { getEventQuery } from "./query.js";
7
8
  function safeCompare(a, b) {
8
9
  if (a.length !== b.length)
9
10
  return false;
@@ -38,7 +39,7 @@ export async function useOgImageBufferCache(ctx, options) {
38
39
  }) : null;
39
40
  if (entry) {
40
41
  const { value, expiresAt, headers } = entry;
41
- const purgeValue = getQuery(ctx.e).purge;
42
+ const purgeValue = getEventQuery(ctx.e).purge;
42
43
  if (typeof purgeValue !== "undefined") {
43
44
  if (options.secret && !safeCompare(String(purgeValue), options.secret)) {
44
45
  return createError({
@@ -0,0 +1,7 @@
1
+ import type { H3Event } from 'h3';
2
+ /**
3
+ * Parse query parameters from the event path without relying on the H3 event
4
+ * implementation. Nitro adapters can pass an H3 v1 event to bundled H3 v2
5
+ * utilities, where getQuery(event) treats the relative req.url as absolute.
6
+ */
7
+ export declare function getEventQuery(event: H3Event): import("ufo").ParsedQuery;
@@ -0,0 +1,4 @@
1
+ import { getQuery } from "ufo";
2
+ export function getEventQuery(event) {
3
+ return getQuery(event.path);
4
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-og-image",
3
3
  "type": "module",
4
- "version": "6.7.3",
4
+ "version": "6.7.4",
5
5
  "description": "Enlightened OG Image generation for Nuxt.",
6
6
  "author": {
7
7
  "website": "https://harlanzw.com",
@@ -118,8 +118,8 @@
118
118
  "magic-string": "^1.0.0",
119
119
  "magicast": "^0.5.3",
120
120
  "mocked-exports": "^0.1.1",
121
- "nuxt-site-config": "^4.1.1",
122
- "nuxtseo-shared": "^5.3.2",
121
+ "nuxt-site-config": "^4.1.2",
122
+ "nuxtseo-shared": "^5.3.3",
123
123
  "nypm": "^0.6.8",
124
124
  "object-identity": "^0.2.3",
125
125
  "ofetch": "^1.5.1",
@@ -139,7 +139,7 @@
139
139
  },
140
140
  "devDependencies": {
141
141
  "@antfu/eslint-config": "^9.1.0",
142
- "@fontsource/noto-sans-sc": "^5.2.9",
142
+ "@fontsource/noto-sans-sc": "^5.3.0",
143
143
  "@iconify-json/carbon": "^1.2.24",
144
144
  "@iconify-json/logos": "^1.2.11",
145
145
  "@iconify-json/noto": "^1.2.7",
@@ -163,11 +163,11 @@
163
163
  "@resvg/resvg-js": "^2.6.2",
164
164
  "@resvg/resvg-wasm": "^2.6.2",
165
165
  "@tailwindcss/vite": "^4.3.3",
166
- "@takumi-rs/core": "^2.3.0",
166
+ "@takumi-rs/core": "^2.3.2",
167
167
  "@takumi-rs/core-v1": "npm:@takumi-rs/core@1.8.7",
168
- "@takumi-rs/helpers": "^2.3.0",
168
+ "@takumi-rs/helpers": "^2.3.2",
169
169
  "@takumi-rs/helpers-v1": "npm:@takumi-rs/helpers@1.8.7",
170
- "@takumi-rs/wasm": "^2.3.0",
170
+ "@takumi-rs/wasm": "^2.3.2",
171
171
  "@takumi-rs/wasm-v1": "npm:@takumi-rs/wasm@1.8.7",
172
172
  "@unocss/nuxt": "^66.7.5",
173
173
  "@unocss/preset-icons": "^66.7.5",
@@ -183,13 +183,13 @@
183
183
  "fontless": "^0.2.1",
184
184
  "get-image-colors": "^4.0.1",
185
185
  "globby": "^16.2.2",
186
- "happy-dom": "^20.10.6",
186
+ "happy-dom": "^20.11.0",
187
187
  "hookable": "^6.1.1",
188
188
  "jest-image-snapshot": "^6.5.2",
189
189
  "lightningcss": "^1.32.0",
190
190
  "nitropack": "^2.13.4",
191
191
  "nuxt": "^4.5.0",
192
- "nuxtseo-layer-devtools": "^5.3.2",
192
+ "nuxtseo-layer-devtools": "^5.3.3",
193
193
  "playwright": "^1.61.1",
194
194
  "playwright-core": "^1.61.1",
195
195
  "sass": "^1.101.0",