summaryrefslogtreecommitdiff
path: root/Main.hsc
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2019-02-20 12:33:50 +0300
committerdefanor <defanor@uberspace.net>2019-02-20 12:33:50 +0300
commit3fcb323b049f076e0dfd2527de981a173e260086 (patch)
treed318252b6491023a22b35d2cdb0b128b10e6984c /Main.hsc
parent58f967265b8f4637de0bf285e99bf7a3051e1961 (diff)
Allow requests without queries
Apply a stylesheet to <pgx:no_query /> in that case. This is slightly out of the project scope, but handy in some cases (helps to avoid dummy queries or additional software), and done with a single line change.
Diffstat (limited to 'Main.hsc')
-rw-r--r--Main.hsc2
1 files changed, 1 insertions, 1 deletions
diff --git a/Main.hsc b/Main.hsc
index 3c247de..47a4366 100644
--- a/Main.hsc
+++ b/Main.hsc
@@ -301,7 +301,7 @@ serve xsltDirectory ioc ps = case lookup "q" ps of
if pNeeded || pUsed
then requireAuth
else redb 500 [("message", "Database connection failed")]
- _ -> respError 418 [("message", "No query is provided")]
+ _ -> resp 200 "<no_query xmlns=\"urn:x-pgxhtml\" />"
where
xsltPath = xsltDirectory </>
takeFileName (BS.unpack $ fromMaybe "default" $ lookup "t" ps)