1
0
Fork 0
mirror of https://github.com/zigzap/zap.git synced 2025-10-20 15:14:08 +00:00

doc: getHeader need lowercase keys

This commit is contained in:
Rene Schallner 2024-07-15 12:29:03 +02:00
parent b77bada381
commit 11fa66a31c

View file

@ -431,8 +431,10 @@ pub fn setContentTypeFromFilename(self: *const Self, filename: []const u8) !void
} }
} }
/// Returns the header value of given key name. Returned mem is temp. /// Returns the header value of given key name.
/// Do not free it. /// NOTE that header-names are lowerased automatically while parsing the request.
/// so please only use lowercase keys!
/// Returned mem is temp. Do not free it.
pub fn getHeader(self: *const Self, name: []const u8) ?[]const u8 { pub fn getHeader(self: *const Self, name: []const u8) ?[]const u8 {
const hname = fio.fiobj_str_new(util.toCharPtr(name), name.len); const hname = fio.fiobj_str_new(util.toCharPtr(name), name.len);
defer fio.fiobj_free_wrapped(hname); defer fio.fiobj_free_wrapped(hname);