@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.
- package/dist/next/index.cjs +5 -0
- package/dist/next/index.js +5 -0
- package/package.json +1 -1
package/dist/next/index.cjs
CHANGED
|
@@ -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
|
}
|
package/dist/next/index.js
CHANGED
|
@@ -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