diff --git a/internal/rule/rulefunction/library.go b/internal/rule/rulefunction/library.go index b0cbf248e..b80fd7628 100644 --- a/internal/rule/rulefunction/library.go +++ b/internal/rule/rulefunction/library.go @@ -1011,7 +1011,7 @@ func LibraryPropertiesUrlFieldDeadLink() (result ruleresult.Type, output string) } logrus.Tracef("Checking URL: %s", url) - httpResponse, err := http.Get(url) + httpResponse, err := http.Head(url) if err != nil { return ruleresult.Fail, err.Error() } diff --git a/internal/rule/rulefunction/library_test.go b/internal/rule/rulefunction/library_test.go index c6df14e2a..86fd4d91f 100644 --- a/internal/rule/rulefunction/library_test.go +++ b/internal/rule/rulefunction/library_test.go @@ -751,7 +751,7 @@ func TestLibraryPropertiesUrlFieldDeadLink(t *testing.T) { testTables := []libraryRuleFunctionTestTable{ {"Unable to load", "InvalidLibraryProperties", ruleresult.NotRun, ""}, {"Not defined", "MissingFields", ruleresult.NotRun, ""}, - {"Bad URL", "BadURL", ruleresult.Fail, "^Get \"http://invalid/\": dial tcp: lookup invalid:"}, + {"Bad URL", "BadURL", ruleresult.Fail, "^Head \"http://invalid/\": dial tcp: lookup invalid:"}, {"HTTP error 404", "URL404", ruleresult.Fail, "^404 Not Found$"}, {"Good URL", "Recursive", ruleresult.Pass, ""}, }