From 17ab5f1c378ebe77a90a608806f290143194ba7a Mon Sep 17 00:00:00 2001 From: fumiama Date: Thu, 3 Jun 2021 16:57:36 +0800 Subject: [PATCH] =?UTF-8?q?shindan=20api=E5=A4=B1=E6=95=88=E6=97=B6?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E5=87=BA=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shindan/shindan.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shindan/shindan.go b/shindan/shindan.go index f1f776b2..b48f9a6b 100644 --- a/shindan/shindan.go +++ b/shindan/shindan.go @@ -119,6 +119,9 @@ func shindanmaker(id, name string) (string, error) { return "", err } defer resp.Body.Close() + if resp.ContentLength <= 0 { + return "出错啦", nil + } // 解析XPATH doc, err := xpath.Parse(resp.Body) if err != nil {