diff --git a/changelogs/unreleased/gh-6143-arm64-debug-build b/changelogs/unreleased/gh-6143-arm64-debug-build
new file mode 100644
index 0000000000000000000000000000000000000000..2df10486f3805b406d000b12cffc3a88b6db9fc4
--- /dev/null
+++ b/changelogs/unreleased/gh-6143-arm64-debug-build
@@ -0,0 +1,3 @@
+## bugfix/build
+
+ * Fix build errors on arm64 with `CMAKE_BUILD_TYPE=Debug`.
diff --git a/src/lib/http_parser/http_parser.c b/src/lib/http_parser/http_parser.c
index 89e40a46306a60bc3d15f06c1a83ba710be90b5f..85c9e487f36482c22c29492154d2406abc167ad9 100644
--- a/src/lib/http_parser/http_parser.c
+++ b/src/lib/http_parser/http_parser.c
@@ -221,7 +221,8 @@ int
 http_parse_header_line(struct http_parser *prsr, char **bufp,
 		       const char *end_buf, int max_hname_len)
 {
-	char c, ch;
+	char c;
+	unsigned char ch;
 	char *p = *bufp;
 	char *header_name_start = p;
 	prsr->hdr_name_idx = 0;
@@ -268,10 +269,6 @@ http_parse_header_line(struct http_parser *prsr, char **bufp,
 				goto header_done;
 			default:
 				state = sw_name;
-
-				if (ch < 0) {
-					return HTTP_PARSE_INVALID;
-				}
 				c = lowcase[ch];
 				if (c != 0) {
 					prsr->hdr_name[0] = c;
@@ -306,9 +303,6 @@ http_parse_header_line(struct http_parser *prsr, char **bufp,
 			break;
 		/* http_header name */
 		case sw_name:
-			if (ch < 0) {
-				return HTTP_PARSE_INVALID;
-			}
 			c = lowcase[ch];
 			if (c != 0) {
 				if (prsr->hdr_name_idx < max_hname_len) {