You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
2.2 KiB
JavaScript
2 lines
2.2 KiB
JavaScript
|
9 months ago
|
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[162],{2067:e=>{"use strict";e.exports=require("node:async_hooks")},6195:e=>{"use strict";e.exports=require("node:buffer")},6074:(e,t,a)=>{"use strict";a.r(t),a.d(t,{ComponentMod:()=>O,default:()=>T});var o={};a.r(o),a.d(o,{GET:()=>c,OPTIONS:()=>h,POST:()=>l,runtime:()=>y});var s={};a.r(s),a.d(s,{headerHooks:()=>m,originalPathname:()=>w,patchFetch:()=>E,requestAsyncStorage:()=>f,routeModule:()=>k,serverHooks:()=>x,staticGenerationAsyncStorage:()=>g,staticGenerationBailout:()=>P});var n=a(7875),r=a(8381),u=a(2251),i=a(9845),d=a(572);async function p(e,{params:t}){let a=new URL(e.url).searchParams.get("endpoint");if("OPTIONS"===e.method)return d.xk.json({body:"OK"},{status:200});let[...o]=t.key;if(!a||!new URL(a).hostname.endsWith(".upstash.io"))return d.xk.json({error:!0,msg:"you are not allowed to request "+t.key.join("/")},{status:403});if("get"!==t.action&&"set"!==t.action)return console.log("[Upstash Route] forbidden action ",t.action),d.xk.json({error:!0,msg:"you are not allowed to request "+t.action},{status:403});let s=`${a}/${t.action}/${t.key.join("/")}`,n=e.method,r=["get","head"].includes(n?.toLowerCase()??""),u={headers:{authorization:e.headers.get("authorization")??""},body:r?null:e.body,method:n,duplex:"half"};console.log("[Upstash Proxy]",s,u);let i=await fetch(s,u);return console.log("[Any Proxy]",s,{status:i.status,statusText:i.statusText}),i}let l=p,c=p,h=p,y="edge",k=new r.AppRouteRouteModule({definition:{kind:u.x.APP_ROUTE,page:"/api/upstash/[action]/[...key]/route",pathname:"/api/upstash/[action]/[...key]",filename:"route",bundlePath:"app/api/upstash/[action]/[...key]/route"},resolvedPagePath:"D:\\NextWeb\\app\\api\\upstash\\[action]\\[...key]\\route.ts",nextConfigOutput:"standalone",userland:o}),{requestAsyncStorage:f,staticGenerationAsyncStorage:g,serverHooks:x,headerHooks:m,staticGenerationBailout:P}=k,w="/api/upstash/[action]/[...key]/route";function E(){return(0,i.XH)({serverHooks:x,staticGenerationAsyncStorage:g})}let O=s,T=n.a.wrap(k)}},e=>{var t=t=>e(e.s=t);e.O(0,[297],()=>t(6074));var a=e.O();(_ENTRIES="undefined"==typeof _ENTRIES?{}:_ENTRIES)["middleware_app/api/upstash/[action]/[...key]/route"]=a}]);
|
||
|
|
//# sourceMappingURL=route.js.map
|