Переглянути джерело

fix(consts): return default identify properties if response status code is not OK

ayn2op 7 місяців тому
батько
коміт
b3f9a2f6fa
1 змінених файлів з 4 додано та 0 видалено
  1. 4 0
      internal/consts/consts.go

+ 4 - 0
internal/consts/consts.go

@@ -71,6 +71,10 @@ func GetIdentifyProps() gateway.IdentifyProperties {
 	}
 	defer resp.Body.Close()
 
+	if resp.StatusCode != http.StatusOK {
+		return defaultIdentifyProps
+	}
+
 	var props Properties
 	if err := json.NewDecoder(resp.Body).Decode(&props); err != nil {
 		return defaultIdentifyProps