-
- add_assoc_stringl(&array, "Request Method", http_line, sep - http_line, 1);
- add_assoc_stringl(&array, "Request Uri", sep + 1, strstr(sep, "HTTP/1.") - sep + 1 + 1, 1);
+ char *url = estrndup(sep + 1, strstr(sep, "HTTP/1.") - sep + 1 + 1);
+ char *met = estrndup(http_line, sep - http_line);
+
+ add_assoc_stringl(&array, "Request Method", met, sep - http_line, 0);
+ add_assoc_stringl(&array, "Request Uri", url, strstr(sep, "HTTP/1.") - sep + 1 + 1, 0);