mirror of
https://github.com/FraMecca/Buridans_donkey.git
synced 2024-03-20 11:20:15 +01:00
print only first of two if only two arguments passed
This commit is contained in:
parent
bab409758c
commit
75045549a6
1 changed files with 4 additions and 1 deletions
|
@ -89,8 +89,11 @@ void handleRequest(scope HTTPServerRequest req, scope HTTPServerResponse res)
|
||||||
auto args = path[2].name.split(",");
|
auto args = path[2].name.split(",");
|
||||||
const result = shuffle(args, engine);
|
const result = shuffle(args, engine);
|
||||||
result.visit!((string [] r) {
|
result.visit!((string [] r) {
|
||||||
immutable body = "Asino says:</br><ul>" ~ "<li>" ~ r.join("</li><li>") ~ "</ul>";
|
|
||||||
res.headers["Content-Type"] = "text/html";
|
res.headers["Content-Type"] = "text/html";
|
||||||
|
immutable body = "Asino says:</br>" ~
|
||||||
|
(r.length == 2 ?
|
||||||
|
r[0] :
|
||||||
|
"<ul><li>" ~ r.join("</li><li>") ~ "</ul>");
|
||||||
res.writeBody(body);
|
res.writeBody(body);
|
||||||
},
|
},
|
||||||
(Error e) { error(); }
|
(Error e) { error(); }
|
||||||
|
|
Loading…
Reference in a new issue