From 627ea612e64b7db5a8c6d8592f3f1894e9542965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B2=B3?= Date: Wed, 4 Dec 2019 04:04:05 +0800 Subject: [PATCH] fix nil pointer --- server/proxy/http.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/proxy/http.go b/server/proxy/http.go index 31ec81c..936aae3 100644 --- a/server/proxy/http.go +++ b/server/proxy/http.go @@ -171,11 +171,11 @@ reset: } }() for { - if resp, err := http.ReadResponse(bufio.NewReader(connClient), r); err != nil { + if resp, err := http.ReadResponse(bufio.NewReader(connClient), r); err != nil || resp == nil { return } else { //if the cache is start and the response is in the extension,store the response to the cache list - if s.useCache && strings.Contains(r.URL.Path, ".") { + if s.useCache && r.URL != nil && strings.Contains(r.URL.Path, ".") { b, err := httputil.DumpResponse(resp, true) if err != nil { return