Skip to content

Commit

Permalink
Nick: skipTls feature flag?
Browse files Browse the repository at this point in the history
  • Loading branch information
nickscamara committed Nov 6, 2024
1 parent 48025e4 commit 8616fe6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
17 changes: 17 additions & 0 deletions apps/api/src/scraper/scrapeURL/engines/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const featureFlags = [
"atsv",
"location",
"mobile",
"skipTlsVerification",
] as const;

export type FeatureFlag = typeof featureFlags[number];
Expand All @@ -50,6 +51,7 @@ export const featureFlagOptions: {
"atsv": { priority: 90 }, // NOTE: should atsv force to tlsclient? adjust priority if not
"location": { priority: 10 },
"mobile": { priority: 10 },
"skipTlsVerification": { priority: 10 },
} as const;

export type EngineScrapeResult = {
Expand Down Expand Up @@ -102,6 +104,7 @@ export const engineOptions: {
"atsv": false,
"location": true,
"mobile": true,
"skipTlsVerification": true,
},
quality: 50,
},
Expand All @@ -116,6 +119,7 @@ export const engineOptions: {
"atsv": false,
"location": false,
"mobile": false,
"skipTlsVerification": false,
},
quality: 40,
},
Expand All @@ -130,6 +134,8 @@ export const engineOptions: {
"atsv": false,
"location": false,
"mobile": false,
"skipTlsVerification": false,

},
quality: 30,
},
Expand All @@ -144,6 +150,8 @@ export const engineOptions: {
"atsv": false,
"location": false,
"mobile": false,
"skipTlsVerification": false,

},
quality: 29,
},
Expand All @@ -158,6 +166,8 @@ export const engineOptions: {
"atsv": false,
"location": false,
"mobile": false,
"skipTlsVerification": false,

},
quality: 20,
},
Expand All @@ -172,6 +182,8 @@ export const engineOptions: {
"atsv": true,
"location": true,
"mobile": false,
"skipTlsVerification": false,

},
quality: 10,
},
Expand All @@ -186,6 +198,8 @@ export const engineOptions: {
"atsv": false,
"location": false,
"mobile": false,
"skipTlsVerification": false,

},
quality: 5,
},
Expand All @@ -200,6 +214,8 @@ export const engineOptions: {
"atsv": false,
"location": false,
"mobile": false,
"skipTlsVerification": false,

},
quality: -10,
},
Expand All @@ -214,6 +230,7 @@ export const engineOptions: {
"atsv": false,
"location": false,
"mobile": false,
"skipTlsVerification": false,
},
quality: -10,
},
Expand Down
4 changes: 4 additions & 0 deletions apps/api/src/scraper/scrapeURL/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ function buildFeatureFlags(url: string, options: ScrapeOptions, internalOptions:
if (options.mobile) {
flags.add("mobile");
}

if (options.skipTlsVerification) {
flags.add("skipTlsVerification");
}

const urlO = new URL(url);

Expand Down

0 comments on commit 8616fe6

Please sign in to comment.