From 5a5a1a364d985ca334f0521f32efb3b22e9495bc Mon Sep 17 00:00:00 2001 From: Skip Grube Date: Mon, 27 Feb 2023 15:21:47 -0500 Subject: [PATCH] Fix Default cdn behavior - CDN returned as-is for processing if no template indicators are found -Skip G. --- pkg/modes/git.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/modes/git.go b/pkg/modes/git.go index 855afdc..4843b12 100644 --- a/pkg/modes/git.go +++ b/pkg/modes/git.go @@ -498,6 +498,11 @@ func (g *GitMode) ImportName(pd *data.ProcessData, md *data.ModeData) string { func ProcessUrl(cdnUrl string, name string, branch string, hash string, hashtype string, filename string) (string, bool) { tmpUrl := Lookaside{name, branch, hash, hashtype, filename} + // Return cdnUrl as-is if we don't have any templates ("{{ .Variable }}") to process: + if !(strings.Contains(cdnUrl, "{{") && strings.Contains(cdnUrl, "}}")) { + return cdnUrl, false + } + // If we run into trouble with our template parsing, we'll just return the cdnUrl, exactly as we found it tmpl, err := template.New("").Parse(cdnUrl) if err != nil {