From 55de743a0ea3e3e705517e8530c312207cfa9c47 Mon Sep 17 00:00:00 2001 From: TommyLike Date: Wed, 15 Apr 2020 16:25:52 +0800 Subject: [PATCH] Fix cookie empty issue --- pkg/cibot/clahandler.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/cibot/clahandler.go b/pkg/cibot/clahandler.go index 9dfaf6e..e642e8d 100644 --- a/pkg/cibot/clahandler.go +++ b/pkg/cibot/clahandler.go @@ -42,6 +42,7 @@ const ( ErrorCode_EmailError ErrorCode_TelephoneError ErrorCode_EmailNotTheSameError + ErrorCode_UnableFindCookie ) const COOKIE_KEY string = "cla-info" @@ -81,6 +82,12 @@ func (s *CLAHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { cookie, err := r.Cookie(COOKIE_KEY) if err != nil { glog.Infof("Get cookie err: %v", err) + s.HandleResult(w, CLAResult{ + IsSuccess: false, + Description: fmt.Sprintf("unable to get cookie: %v", err), + ErrorCode: ErrorCode_UnableFindCookie, + }) + return } glog.Infof("cla request content: %v", clarequest) -- Gitee