fix(submit): 审阅绑定上下文 sha256,批准须带摘要,构建只从内部 API 取上下文并校验字节
This commit is contained in:
30 files changed
+910
-98
No files matched your search
@@ -70,6 +70,11 @@ func withRecover(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
defer func() {
|
||||
if rec := recover(); rec != nil {
|
||||
if rec == http.ErrAbortHandler {
|
||||
// A deliberate abort of a committed response (see
|
||||
// streamSubmissionContext): let net/http cut the connection.
|
||||
panic(rec)
|
||||
}
|
||||
log.Printf("api: %s %s: panic (request_id=%s): %v\n%s",
|
||||
r.Method, r.URL.Path, requestIDFromContext(r.Context()), rec, debug.Stack())
|
||||
writeError(w, r, newError(http.StatusInternalServerError, "panic", "internal error"))
|
||||
|
||||
Reference in new issue
Block a user