diff --git a/CHANGELOG.md b/CHANGELOG.md index ca3d1c1..6aeadc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed * Updated header style of cards +* Observations: Updated to use arweave.net for reference domain when generating observation report ## [1.3.0] - 2024-10-21 diff --git a/src/constants.ts b/src/constants.ts index 34820e0..a35791e 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -54,3 +54,8 @@ export const EAY_TOOLTIP_FORMULA = export const OPERATOR_EAY_TOOLTIP_FORMULA = '\\(EAY = \\frac{OperatorRewardsPerEpoch}{OperatorStake} * EpochsPerYear\\)'; + +// OBSERVATION ASSESSMENT CONSTANTS +export const NAME_PASS_THRESHOLD = 0.8; +export const REFERENCE_GATEWAY_FQDN = + process.env.VITE_REFERENCE_GATEWAY_FQDN ?? 'arweave.net'; diff --git a/src/utils/index.ts b/src/utils/index.ts index 78c13b2..a755c96 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -104,6 +104,10 @@ export const fetchWithTimeout = async (resource:string, options?:RequestInit, ti const response = await fetch(resource, { ...options, + headers: { + ...options?.headers, + 'Accept-Encoding': 'identity' + }, signal: controller.signal }); clearTimeout(id); diff --git a/src/utils/observations.ts b/src/utils/observations.ts index 8545497..d5c4836 100644 --- a/src/utils/observations.ts +++ b/src/utils/observations.ts @@ -1,13 +1,10 @@ /* Based on code by elliotsayes from https://github.com/elliotsayes/gateway-explorer */ import { AoGatewayWithAddress } from '@ar.io/sdk/web'; -import { log } from '@src/constants'; +import { log, NAME_PASS_THRESHOLD, REFERENCE_GATEWAY_FQDN } from '@src/constants'; import { ArNSAssessment, Assessment, OwnershipAssessment } from '@src/types'; import { arrayBufferToBase64Url, fetchWithTimeout } from '.'; -const NAME_PASS_THRESHOLD = 0.8; -const REFERENCE_GATEWAY_FQDN = 'ar-io.dev'; - export const assessOwnership = async ( gateway: AoGatewayWithAddress, ): Promise => {