diff options
Diffstat (limited to 'source/app.d')
-rw-r--r-- | source/app.d | 13 |
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) { |