forked from cory/tildefriends
Fix /speedscope/ => deps/speedscope/index.html.
This commit is contained in:
@ -626,11 +626,15 @@ static const char* _ext_to_content_type(const char* ext)
|
||||
{
|
||||
if (ext)
|
||||
{
|
||||
if (strcmp(ext, ".js") == 0 || strcmp(ext, ".mjs") == 0)
|
||||
if (strcmp(ext, ".html") == 0)
|
||||
{
|
||||
return "text/html; charset=UTF-8";
|
||||
}
|
||||
else if (strcmp(ext, ".js") == 0 || strcmp(ext, ".mjs") == 0)
|
||||
{
|
||||
return "text/javascript; charset=UTF-8";
|
||||
}
|
||||
if (strcmp(ext, ".css") == 0)
|
||||
else if (strcmp(ext, ".css") == 0)
|
||||
{
|
||||
return "text/css; charset=UTF-8";
|
||||
}
|
||||
@ -748,6 +752,11 @@ static void _httpd_endpoint_static(tf_http_request_t* request)
|
||||
is_core = is_core || (after && i == 0);
|
||||
}
|
||||
|
||||
if (strcmp(request->path, "/speedscope/") == 0)
|
||||
{
|
||||
after = "index.html";
|
||||
}
|
||||
|
||||
if (!after || strstr(after, ".."))
|
||||
{
|
||||
const char* k_payload = tf_http_status_text(404);
|
||||
|
Reference in New Issue
Block a user