aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2019-07-04 23:58:49 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2019-07-04 23:58:49 -0400
commita8c7b3c928a220565a34d2d3a6ffc4f69d9e10ae (patch)
tree6f2edc9470368dd0c217618f58fe8b68b5d37ab4
parent0c609fcaaec4ea1ed3294e670ca8ab8a01c3847c (diff)
downloadjdtalk_web-a8c7b3c928a220565a34d2d3a6ffc4f69d9e10ae.tar.gz
Support latest options
-rw-r--r--source/app.d13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/app.d b/source/app.d
index 9c603d5..7d557c9 100644
--- a/source/app.d
+++ b/source/app.d
@@ -20,6 +20,9 @@ void handleRequest(scope HTTPServerRequest req, scope HTTPServerResponse res)
auto limit = req.query.get("limit", "1").to!long;
auto pattern = req.query.get("pattern", null);
auto exactMatch = req.query.get("exact", "false").to!bool;
+ auto rCase = req.query.get("rcase", "false").to!bool;
+ auto hCase = req.query.get("hcase", "false").to!bool;
+ auto haxor = req.query.get("leet", "false").to!bool;
if (pattern is null && limit > MAX_LIMIT) {
res.bodyWriter.write(format("Requested too many: %d (MAX: %d)\n",
@@ -49,6 +52,16 @@ void handleRequest(scope HTTPServerRequest req, scope HTTPServerResponse res)
}
}
+ if (rCase) {
+ output = randomCase(output);
+ }
+ else if (hCase) {
+ output = hillCase(output);
+ }
+ else if (haxor) {
+ output = leetSpeak(output);
+ }
+
res.bodyWriter.write(format("%s\n", output));
if (limit > 0) {