diff options
| author | 2019-02-27 01:18:13 -0500 | |
|---|---|---|
| committer | 2019-02-27 01:18:13 -0500 | |
| commit | 76a43bd6a29e3d551ec3976582b30f01e0f0973f (patch) | |
| tree | e9d5f5284392abda65ba994ae9919684ca020a88 | |
| parent | Fix example usage (diff) | |
Allow using ?lang=x style language selection
| -rw-r--r-- | source/web.d | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/web.d b/source/web.d index a8ddc79..eddd55e 100644 --- a/source/web.d +++ b/source/web.d @@ -10,7 +10,8 @@ void id(HTTPServerRequest req, HTTPServerResponse res) { string id = req.params["id"]; string language = "none"; // TODO: rewrite the next two lines once #2273 is resolved - if (req.query.length > 0) language = req.query.byKey.front; + if ("lang" in req.query) language = req.query["lang"]; + else if (req.query.length > 0) language = req.query.byKey.front; enforceHTTP(client.exists(id), HTTPStatus.notFound, "No paste under " ~ id ~ "."); auto data = client.get(id); |
