@aziontech/opennextjs-azion
Version:
Azion builder for next apps
4 lines (3 loc) • 2.22 kB
TypeScript
import type { CodePatcher } from "@opennextjs/aws/build/patch/codePatcher.js";
export declare const rule = "\nrule:\n kind: await_expression\n inside:\n kind: if_statement\n stopBy: end\n has:\n kind: parenthesized_expression\n has: { kind: property_identifier , stopBy: end, regex: trustHostHeader}\n has:\n kind: call_expression\n all:\n - has: {kind: identifier, pattern: fetch}\n - has:\n kind: arguments\n all:\n - has:\n kind: object\n all:\n - has:\n kind: pair\n all:\n - has: {kind: property_identifier, regex: method }\n - has: {kind: string, regex: 'HEAD'}\n - has:\n kind: pair\n all:\n - has: {kind: property_identifier, regex: headers}\n - has: {kind: identifier, pattern: $HEADERS}\n - has:\n kind: template_string\n all:\n - has:\n kind: string_fragment\n regex: https://\n - has:\n kind: template_substitution\n all:\n - has: { kind: identifier, stopBy: end, pattern: $REQ }\n - has:\n kind: property_identifier\n regex: headers\n stopBy: end\n - has:\n kind: property_identifier\n regex: host\n stopBy: end\n - has:\n kind: template_substitution\n pattern: $URL_PATH\n has:\n kind: identifier\n\nfix: await (await import(\"@aziontech/opennextjs-azion\")).getAzionContext().env.WORKER_SELF_REFERENCE.fetch(`${$REQ.headers.host.includes(\"localhost\") ? \"http\":\"https\" }://${$REQ.headers.host}$URL_PATH`,{method:'HEAD', headers:$HEADERS})\n";
export declare const patchResRevalidate: CodePatcher;