fix: fix the status code hint bug.

This commit is contained in:
lishuang
2023-07-22 15:45:07 +08:00
parent 3fc032daa9
commit e34a26c009
+4
View File
@@ -1241,6 +1241,10 @@ func (this *MatterService) AtomicCrawl(request *http.Request, url string, filena
//download from url.
resp, err := http.Get(url)
this.PanicError(err)
//if resp is not ok.
if resp.StatusCode != 200 {
panic(result.BadRequest("error when crawl from url."))
}
return this.Upload(request, resp.Body, nil, user, space, dirMatter, filename, privacy)
}