Skip to content

Commit

Permalink
removing proxy config option and editing proxy demo to reflect changes
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-fichtel-adobe committed Feb 13, 2023
1 parent 4f4d13c commit 35e3f73
Show file tree
Hide file tree
Showing 13 changed files with 1,014 additions and 253 deletions.
54 changes: 0 additions & 54 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,5 @@
"lerna": "^4.0.0",
"prettier": "^2.7.1",
"pretty-quick": "^3.1.3"
},
"dependencies": {
"undici": "^5.18.0"
}
}
1 change: 0 additions & 1 deletion packages/target-decisioning-engine/src/artifactProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ function ArtifactProvider(config, telemetryProvider) {

const fetchWithRetry = getFetchWithRetry(
fetchApi,
config.proxyAgent,
NUM_FETCH_RETRIES,
errorMessage => Messages.ERROR_MAX_RETRY(NUM_FETCH_RETRIES, errorMessage),
error => eventEmitter(ARTIFACT_DOWNLOAD_FAILED, { artifactLocation, error })
Expand Down
10 changes: 3 additions & 7 deletions packages/target-decisioning-engine/src/geoProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,9 @@ export function GeoProvider(config, artifact) {
headers[HTTP_HEADER_FORWARDED_FOR] = geoRequestContext.ipAddress;
}

const options = { headers };

if (config.proxyAgent != null) {
options.dispatcher = config.proxyAgent;
}

return fetchApi(geoLookupPath, options)
return fetchApi(geoLookupPath, {
headers
})
.then(geoResponse =>
geoResponse
.json()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { DecisioningArtifact } from "./DecisioningArtifact";
import { ParseDomainFunc } from "./DecisioningContext";
import { ProxyAgent } from "undici";

export interface DecisioningConfig {
/**
Expand Down Expand Up @@ -87,9 +86,4 @@ export interface DecisioningConfig {
* Function used to parse domains
*/
parseDomainImpl?: ParseDomainFunc;

/**
* Proxy Agent to specify a proxy for the fetch implementation
*/
proxyAgent: ProxyAgent;
}
Loading

0 comments on commit 35e3f73

Please sign in to comment.