From ded1167a74559bb1cd9e399ad3df1843ea694bb9 Mon Sep 17 00:00:00 2001 From: Elliot Campbell Date: Thu, 22 Aug 2024 14:01:55 -0400 Subject: [PATCH] add an advanced option that will override the v2 in the config url with v1 --- configmanager.go | 10 ++++++++-- configuration.go | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/configmanager.go b/configmanager.go index 79d78c8a..e1a59b63 100644 --- a/configmanager.go +++ b/configmanager.go @@ -391,11 +391,17 @@ func (e *EnvironmentConfigManager) setConfig(config []byte, eTag, rayId, lastMod } func (e *EnvironmentConfigManager) getConfigURL() string { - configBasePath := e.cfg.ConfigCDNBasePath + configBasePath := e.cfg.ConfigCDNBasePath - return fmt.Sprintf("%s/config/v2/server/%s.json", configBasePath, e.sdkKey) + version := "v2" + if e.options.AdvancedOptions.OverrideConfigWithV1 { + version = "v1" + } + + return fmt.Sprintf("%s/config/%s/server/%s.json", configBasePath, version, e.sdkKey) } + func (e *EnvironmentConfigManager) HasConfig() bool { return e.localBucketing.HasConfig() } diff --git a/configuration.go b/configuration.go index aa76da69..3e725e88 100644 --- a/configuration.go +++ b/configuration.go @@ -16,6 +16,7 @@ type EventQueueOptions = api.EventQueueOptions type AdvancedOptions struct { OverridePlatformData *api.PlatformData + OverrideConfigWithV1 bool } type Options struct {