瀏覽代碼

respond with 200 with additional info instead of 204

backfeed-full-error
Fusl 2 年之前
父節點
當前提交
591252f581
共有 1 個檔案被更改,包括 7 行新增1 行删除
  1. +7
    -1
      main.go

+ 7
- 1
main.go 查看文件

@@ -427,6 +427,7 @@ func (that *GlobalBackfeedManager) Handle(res http.ResponseWriter, req *http.Req

var err error
statusCode := http.StatusNoContent
n := 0
for scanner.Scan() {
b := scanner.Bytes()
if len(b) == 0 {
@@ -443,6 +444,7 @@ func (that *GlobalBackfeedManager) Handle(res http.ResponseWriter, req *http.Req
statusCode = http.StatusServiceUnavailable
break
}
n++
}
if err == nil {
err = scanner.Err()
@@ -450,7 +452,11 @@ func (that *GlobalBackfeedManager) Handle(res http.ResponseWriter, req *http.Req
statusCode = http.StatusBadRequest
}
}
WriteResponse(res, statusCode, err)
if err != nil {
WriteResponse(res, statusCode, err)
} else {
WriteResponse(res, http.StatusOK, fmt.Sprintf("%d items queued", n))
}
return
}



Loading…
取消
儲存