Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions library/agent/Context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export type Context = {
route: string | undefined;
graphql?: string[];
xml?: unknown[];
rawBody?: unknown;
subdomains?: string[]; // https://expressjs.com/en/5x/api.html#req.subdomains
markUnsafe?: unknown[];
cache?: ReturnType<typeof extractStringsFromUserInput>;
Expand Down Expand Up @@ -90,6 +91,7 @@ export function runWithContext<T>(context: Context, fn: () => T) {
current.route = context.route;
current.graphql = context.graphql;
current.xml = context.xml;
current.rawBody = context.rawBody;
current.subdomains = context.subdomains;
current.outgoingRequestRedirects = context.outgoingRequestRedirects;
current.markUnsafe = context.markUnsafe;
Expand Down
1 change: 1 addition & 0 deletions library/agent/Source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const SOURCES = [
"subdomains",
"markUnsafe",
"url",
"rawBody",
] as const;

export type Source = (typeof SOURCES)[number];
2 changes: 2 additions & 0 deletions library/agent/protect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { LoggerConsole } from "./logger/LoggerConsole";
import { LoggerNoop } from "./logger/LoggerNoop";
import { GraphQL } from "../sources/GraphQL";
import { Xml2js } from "../sources/Xml2js";
import { RawBody } from "../sources/RawBody";
import { FastXmlParser } from "../sources/FastXmlParser";
import { SQLite3 } from "../sinks/SQLite3";
import { XmlMinusJs } from "../sources/XmlMinusJs";
Expand Down Expand Up @@ -155,6 +156,7 @@ export function getWrappers() {
new Anthropic(),
new Xml2js(),
new FastXmlParser(),
new RawBody(),
new SQLite3(),
new XmlMinusJs(),
new Shelljs(),
Expand Down
Loading