FS: Get CDN prefix from configuration (#110615)

* FS: Get CDN prefix from configuration

* undo logger change

* fix tests

* add unused property

* tests

* fix tests

* remove dead comment
This commit is contained in:
Josh Hunt
2025-09-08 15:57:03 +00:00
committed by GitHub
parent 2f2950eb29
commit 454380431d
10 changed files with 143 additions and 52 deletions
+2 -2
View File
@@ -60,7 +60,7 @@ func GetWebAssets(ctx context.Context, cfg *setting.Cfg, license licensing.Licen
}
if result == nil {
result, err = readWebAssetsFromFile(filepath.Join(cfg.StaticRootPath, "build", "assets-manifest.json"))
result, err = ReadWebAssetsFromFile(filepath.Join(cfg.StaticRootPath, "build", "assets-manifest.json"))
if err == nil {
cdn, _ = cfg.GetContentDeliveryURL(license.ContentDeliveryPrefix())
if cdn != "" {
@@ -73,7 +73,7 @@ func GetWebAssets(ctx context.Context, cfg *setting.Cfg, license licensing.Licen
return entryPointAssetsCache, err
}
func readWebAssetsFromFile(manifestpath string) (*dtos.EntryPointAssets, error) {
func ReadWebAssetsFromFile(manifestpath string) (*dtos.EntryPointAssets, error) {
//nolint:gosec
f, err := os.Open(manifestpath)
if err != nil {
+1 -1
View File
@@ -10,7 +10,7 @@ import (
)
func TestReadWebassets(t *testing.T) {
assets, err := readWebAssetsFromFile("testdata/sample-assets-manifest.json")
assets, err := ReadWebAssetsFromFile("testdata/build/assets-manifest.json")
require.NoError(t, err)
dto, err := json.MarshalIndent(assets, "", " ")