Don't need to actually catch any exceptions there...

master
Luqman Aden 11 years ago
parent 259b9f6476
commit 1ae5e4b5b5
  1. 24
      src/web.d

@ -93,13 +93,11 @@ void do_content(string url) {
html_push("<div id=\"main-copy\"" ~ (nav_tree_vert? " class=\"main-copy-side-bar\"" : "") ~ ">");
// first, see if we have something that wants to handle url outright
foreach (StaticRegex!char reg, string h; handlers) {
try {
if (match(url, reg)) {
html(shell(dweb_root ~ "/bin/" ~ h ~ " " ~ url));
html_pop("</div>");
return;
}
} catch (std.regex.RegexException re) { continue; }
if (match(url, reg)) {
html(shell(dweb_root ~ "/bin/" ~ h ~ " " ~ url));
html_pop("</div>");
return;
}
}
// if that failed, see if we can handle the file
if (url == "" ? true : url[$-1] == '/') url ~= "index";
@ -108,13 +106,11 @@ void do_content(string url) {
string name = baseName(f); name = name[0] == '@' ? name[1..$] : name;
if (stripExtension(name) == baseName(url)) {
foreach (StaticRegex!char reg, string h; handlers) {
try {
if (match(name, reg)) {
html(shell(dweb_root ~ "/bin/" ~ h ~ " " ~ f));
html_pop("</div>");
return;
}
} catch (std.regex.RegexException re) { continue; }
if (match(name, reg)) {
html(shell(dweb_root ~ "/bin/" ~ h ~ " " ~ f));
html_pop("</div>");
return;
}
}
}
}

Loading…
Cancel
Save