summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobbie Harwood <rharwood@redhat.com>2021-09-01 11:10:32 -0400
committerRobbie Harwood <rharwood@redhat.com>2021-09-01 11:10:32 -0400
commit204f6bb5ba94061c8d0c60a6969fb263aadfce2d (patch)
tree0bec383b9f8e2afa7231f09b58d2cbd7808c032a
parent1b30c2b9e5ee7d3e305a28a92805152d5cbfc9cb (diff)
downloadefi-boot-shim-204f6bb5ba94061c8d0c60a6969fb263aadfce2d.tar.gz
efi-boot-shim-204f6bb5ba94061c8d0c60a6969fb263aadfce2d.zip
httpboot: Ignore case when checking HTTP headers
Some servers (HAProxy) yield Content-Length in lowercase, and shim would fail to find it. Signed-off-by: Robbie Harwood <rharwood@redhat.com>
-rw-r--r--httpboot.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/httpboot.c b/httpboot.c
index 93d88931..5d16bc1e 100644
--- a/httpboot.c
+++ b/httpboot.c
@@ -571,7 +571,8 @@ receive_http_response(EFI_HTTP_PROTOCOL *http, VOID **buffer, UINT64 *buf_size)
/* Check the length of the file */
for (i = 0; i < rx_message.HeaderCount; i++) {
- if (!strcmp(rx_message.Headers[i].FieldName, (CHAR8 *)"Content-Length")) {
+ if (!strcasecmp(rx_message.Headers[i].FieldName,
+ (CHAR8 *)"Content-Length")) {
*buf_size = ascii_to_int(rx_message.Headers[i].FieldValue);
}
}