implemented responses for PUT and OPTIONS

This commit is contained in:
Altair-sh
2026-11-06 03:09:01 +01:00
parent 7a43e7f8c9
commit 2098082aa6
11 changed files with 206 additions and 33 deletions
+2 -2
View File
@@ -92,7 +92,7 @@ func (conn *Connection) Start() {
conn.log.Info(req.Method, " ", req.Url, " ", req.Protocol)
conn.log.Trace("request headers: ", HeadersToString(req.Headers, SecretHeaders))
res = conn.callback(req)
if req.HasUnreadBody() {
if !res.CloseConnection && req.HasUnreadBody() {
res = conn.CreateErrorResponse(req, true, ErrHasUnreadBody)
}
}
@@ -107,7 +107,7 @@ func (conn *Connection) Start() {
}
// it is set by CreateResponse
if res.Headers["connection"] == "close" {
if res.CloseConnection {
conn.lingeringClose()
return
}