���Root Mod By V1rus_Alfa
User / IP
:
216.73.217.78
Host / Server
:
195.214.235.115 / npln.ir
System
:
Linux damavand.pws-dns.net 5.14.0-503.35.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 4 05:23:43 EDT 2025 x86_64
Command
|
Upload
|
Mass Deface
|
Create
:
/
home2
/
cutunixc
/
.trash
/
node_modules
/
nitropack
/
dist
/
runtime
/
Viewing: route-rules.mjs
import { eventHandler, sendRedirect, setHeaders, proxyRequest } from "h3"; import defu from "defu"; import { createRouter as createRadixRouter, toRouteMatcher } from "radix3"; import { joinURL, withQuery, getQuery, withoutBase } from "ufo"; import { useRuntimeConfig } from "./config.mjs"; const config = useRuntimeConfig(); const _routeRulesMatcher = toRouteMatcher( createRadixRouter({ routes: config.nitro.routeRules }) ); export function createRouteRulesHandler(ctx) { return eventHandler((event) => { const routeRules = getRouteRules(event); if (routeRules.headers) { setHeaders(event, routeRules.headers); } if (routeRules.redirect) { let target = routeRules.redirect.to; if (target.endsWith("/**")) { let targetPath = event.path; const strpBase = routeRules.redirect._redirectStripBase; if (strpBase) { targetPath = withoutBase(targetPath, strpBase); } target = joinURL(target.slice(0, -3), targetPath); } else if (event.path.includes("?")) { const query = getQuery(event.path); target = withQuery(target, query); } return sendRedirect(event, target, routeRules.redirect.statusCode); } if (routeRules.proxy) { let target = routeRules.proxy.to; if (target.endsWith("/**")) { let targetPath = event.path; const strpBase = routeRules.proxy._proxyStripBase; if (strpBase) { targetPath = withoutBase(targetPath, strpBase); } target = joinURL(target.slice(0, -3), targetPath); } else if (event.path.includes("?")) { const query = getQuery(event.path); target = withQuery(target, query); } return proxyRequest(event, target, { fetch: ctx.localFetch, ...routeRules.proxy }); } }); } export function getRouteRules(event) { event.context._nitro = event.context._nitro || {}; if (!event.context._nitro.routeRules) { event.context._nitro.routeRules = getRouteRulesForPath( withoutBase(event.path.split("?")[0], useRuntimeConfig().app.baseURL) ); } return event.context._nitro.routeRules; } export function getRouteRulesForPath(path) { return defu({}, ..._routeRulesMatcher.matchAll(path).reverse()); }
Coded With 💗 by
0x6ick Mod By V1rus_Alfa