fix: 暂时注释head检查
This commit is contained in:
parent
3c5faddece
commit
feccc12e39
@ -46,19 +46,19 @@ func CheckRssFeed(feedURL string) error {
|
||||
|
||||
func ParseFeed(feedURL string) (string, []RssItem, error) {
|
||||
//确认大小
|
||||
resp, err := http.Head(feedURL)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
if resp.StatusCode != 200 {
|
||||
return "", nil, fmt.Errorf("RSS源无效: %d", resp.StatusCode)
|
||||
}
|
||||
if resp.ContentLength == 0 || resp.ContentLength > 1024*1024*10 {
|
||||
return "", nil, fmt.Errorf("RSS源的大小为%d,超出限制", resp.ContentLength)
|
||||
}
|
||||
// resp, err := http.Head(feedURL)
|
||||
// if err != nil {
|
||||
// return "", nil, err
|
||||
// }
|
||||
// if resp.StatusCode != 200 {
|
||||
// return "", nil, fmt.Errorf("RSS源无效: %d", resp.StatusCode)
|
||||
// }
|
||||
// if resp.ContentLength == 0 || resp.ContentLength > 1024*1024*10 {
|
||||
// return "", nil, fmt.Errorf("RSS源的大小为%d,超出限制", resp.ContentLength)
|
||||
// }
|
||||
|
||||
//获取rss数据
|
||||
resp, err = http.Get(feedURL)
|
||||
resp, err := http.Get(feedURL)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user