Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
timokoessler committed Jan 20, 2025
1 parent 15e17ea commit 6477fcd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions library/sinks/Fetch.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable max-lines-per-function */
import { lookup } from "dns";
import { Agent } from "../agent/Agent";
import { getContext } from "../agent/Context";
Expand Down Expand Up @@ -37,6 +38,7 @@ export class Fetch implements Wrapper {

inspectFetch(args: unknown[], agent: Agent): InterceptorResult {
if (args.length > 0) {
// URL string
if (typeof args[0] === "string" && args[0].length > 0) {
const url = tryParseURL(args[0]);
if (url) {
Expand Down Expand Up @@ -69,6 +71,7 @@ export class Fetch implements Wrapper {
}
}

// URL object
if (args[0] instanceof URL && args[0].hostname.length > 0) {
const attack = this.inspectHostname(
agent,
Expand All @@ -80,6 +83,7 @@ export class Fetch implements Wrapper {
}
}

// Request object
if (args[0] instanceof Request) {
const url = tryParseURL(args[0].url);
if (url) {
Expand Down

0 comments on commit 6477fcd

Please sign in to comment.