diff options
-rw-r--r-- | Main.hsc | 2 | ||||
-rw-r--r-- | example/common.xsl | 4 |
2 files changed, 5 insertions, 1 deletions
@@ -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) diff --git a/example/common.xsl b/example/common.xsl index 15838ba..c832552 100644 --- a/example/common.xsl +++ b/example/common.xsl @@ -41,4 +41,8 @@ <dd><xsl:copy-of select="text()" /></dd> </xsl:template> + <xsl:template match="pgx:no_query"> + <p>No query is provided.</p> + </xsl:template> + </xsl:stylesheet> |