Преглед на файлове

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