소스 검색

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