@alleyboss/micropay-solana-x402-paywall 3.3.5 → 3.3.7

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.
@@ -245,10 +245,15 @@ function createX402Middleware(config) {
245
245
  return async (req, ctx) => {
246
246
  const compatibleReq = new Proxy(req, {
247
247
  get(target, prop) {
248
+ console.error(`[ProxyDebug] Access req.${String(prop)}`);
249
+ if (prop === "url") {
250
+ return target.nextUrl?.pathname || target.url;
251
+ }
248
252
  if (prop === "headers") {
249
253
  const headers = target.headers;
250
254
  return new Proxy(headers, {
251
255
  get(hTarget, hProp) {
256
+ console.error(`[ProxyDebug] Access req.headers.${String(hProp)}`);
252
257
  if (typeof hProp === "string" && !["get", "set", "has", "delete", "entries", "keys", "values", "forEach", "append"].includes(hProp) && typeof hTarget[hProp] === "undefined") {
253
258
  return hTarget.get(hProp) || void 0;
254
259
  }
@@ -244,10 +244,15 @@ function createX402Middleware(config) {
244
244
  return async (req, ctx) => {
245
245
  const compatibleReq = new Proxy(req, {
246
246
  get(target, prop) {
247
+ console.error(`[ProxyDebug] Access req.${String(prop)}`);
248
+ if (prop === "url") {
249
+ return target.nextUrl?.pathname || target.url;
250
+ }
247
251
  if (prop === "headers") {
248
252
  const headers = target.headers;
249
253
  return new Proxy(headers, {
250
254
  get(hTarget, hProp) {
255
+ console.error(`[ProxyDebug] Access req.headers.${String(hProp)}`);
251
256
  if (typeof hProp === "string" && !["get", "set", "has", "delete", "entries", "keys", "values", "forEach", "append"].includes(hProp) && typeof hTarget[hProp] === "undefined") {
252
257
  return hTarget.get(hProp) || void 0;
253
258
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alleyboss/micropay-solana-x402-paywall",
3
- "version": "3.3.5",
3
+ "version": "3.3.7",
4
4
  "description": "Production-ready Solana micropayments library wrapper for official x402 SDK",
5
5
  "author": "AlleyBoss",
6
6
  "license": "MIT",