Commit 0084accb authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

url: strip request parameters in make_path()

parent 48255c99
......@@ -271,12 +271,9 @@ char *make_path (const char *url)
size_t schemelen = ((end != NULL) ? end : path) - url;
path += 3; /* skip "://" */
/* Remove HTML anchor if present */
end = strchr (path, '#');
if (end)
path = strndup (path, end - path);
else
path = strdup (path);
/* Remove request parameters and/or HTML anchor if present */
end = path + strcspn (path, "?#");
path = strndup (path, end - path);
if (unlikely(path == NULL))
return NULL; /* boom! */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment