@@ -29,13 +29,7 @@ func UpdateDependencies(cnf *config.Config) {
2929 for {
3030 time .Sleep (checkEvery )
3131
32- headers := map [string ]string {
33- "key" : cnf .AgentKey ,
34- "id" : fmt .Sprintf ("%v" , cnf .AgentID ),
35- "type" : "agent" ,
36- }
37-
38- if err := utils .DownloadFile (fmt .Sprintf (config .DependUrl , cnf .Server , config .DependenciesPort , "version.json" ), headers , "version_new.json" , utils .GetMyPath (), cnf .SkipCertValidation ); err != nil {
32+ if err := utils .DownloadFile (fmt .Sprintf (config .DependUrl , cnf .Server , config .DependenciesPort , "version.json" ), map [string ]string {}, "version_new.json" , utils .GetMyPath (), cnf .SkipCertValidation ); err != nil {
3933 utils .Logger .ErrorF ("error downloading version.json: %v" , err )
4034 continue
4135 }
@@ -48,7 +42,7 @@ func UpdateDependencies(cnf *config.Config) {
4842
4943 if newVersion .Version != currentVersion .Version {
5044 utils .Logger .Info ("New version of agent found: %s" , newVersion .Version )
51- if err := utils .DownloadFile (fmt .Sprintf (config .DependUrl , cnf .Server , config .DependenciesPort , fmt .Sprintf (config .ServiceFile , "" )), headers , fmt .Sprintf (config .ServiceFile , "_new" ), utils .GetMyPath (), cnf .SkipCertValidation ); err != nil {
45+ if err := utils .DownloadFile (fmt .Sprintf (config .DependUrl , cnf .Server , config .DependenciesPort , fmt .Sprintf (config .ServiceFile , "" )), map [ string ] string {} , fmt .Sprintf (config .ServiceFile , "_new" ), utils .GetMyPath (), cnf .SkipCertValidation ); err != nil {
5246 utils .Logger .ErrorF ("error downloading agent: %v" , err )
5347 continue
5448 }
0 commit comments