implemented authorization

This commit is contained in:
Altair-sh
2026-11-04 17:08:55 +01:00
parent beff40ae8c
commit 7987c9e580
8 changed files with 124 additions and 11 deletions
+11
View File
@@ -122,6 +122,17 @@ func (res *Response) WithBodyReader(body io.Reader,
return res
}
func (res *Response) WithHeader(k, v string) *Response {
res.Headers[k] = v
return res
}
func (res *Response) WithHeaderI(k string, v int64) *Response {
return res.WithHeader(k, strconv.FormatInt(v, 10))
}
func (res *Response) WithHeaderU(k string, v uint64) *Response {
return res.WithHeader(k, strconv.FormatUint(v, 10))
}
func (conn *Connection) CreateErrorResponse(
req *Request, wantsClose bool, httpErr *HttpError,
) *Response {