case insensitive header search

This commit is contained in:
Emil Lerch 2022-01-17 13:44:29 -08:00
parent d0dd2507d4
commit a3967b8652
Signed by: lobo
GPG Key ID: A7B62D657EF764F8

View File

@ -227,7 +227,7 @@ pub fn Request(comptime action: anytype) type {
// look at the return type
var isJson: bool = undefined;
for (response.headers) |h| {
if (std.mem.eql(u8, "Content-Type", h.name)) {
if (std.ascii.eqlIgnoreCase("Content-Type", h.name)) {
if (std.mem.startsWith(u8, h.value, "application/json")) {
isJson = true;
} else if (std.mem.startsWith(u8, h.value, "application/x-amz-json-1.0")) {