diff --git a/src/http.c b/src/http.c index bed1f51f..37df3a82 100644 --- a/src/http.c +++ b/src/http.c @@ -1002,7 +1002,7 @@ static void parseFirstLine(Webs *wp) start of the URL. Non-proxied will just be local path names. */ host = path = port = query = ext = NULL; - if (websUrlParse(url, &buf, NULL, &host, &port, &path, &ext, NULL, &query) < 0) { + if (websUrlParse(url, &buf, NULL, &host, &port, &path, NULL, NULL, &query) < 0) { error("Cannot parse URL: %s", url); websError(wp, HTTP_CODE_BAD_REQUEST | WEBS_CLOSE | WEBS_NOLOG, "Bad URL"); return; @@ -1013,7 +1013,7 @@ static void parseFirstLine(Webs *wp) return; } wp->url = sclone(url); - if (ext) { + if ((ext = strrchr(wp->path, '.')) != NULL) { wp->ext = sclone(slower(ext)); } wp->filename = sfmt("%s%s", websGetDocuments(), wp->path);