Simplify print statements by using HTTP_UNPACK

This commit is contained in:
2025-07-20 21:29:41 +02:00
parent 1c6c0a75cf
commit 3b196546da
4 changed files with 8 additions and 18 deletions
+2 -2
View File
@@ -48,7 +48,7 @@ int main(void)
// sure to express the length when interacting with
// libc:
HTTP_String path = req->url.path;
printf("requested path [%.*s]\n", (int) path.len, path.ptr);
printf("requested path [%.*s]\n", HTTP_UNPACK(path));
// To find a specific header value, you can either
// iterate over the [req->headers] array or use
@@ -60,7 +60,7 @@ int main(void)
} else {
// Found
HTTP_String value = req->headers[idx].value;
printf("Header has value [%.*s]\n", (int) value.len, value.ptr);
printf("Header has value [%.*s]\n", HTTP_UNPACK(value));
}
// To create a response, you will need to specify