]> git.ipfire.org Git - pbs.git/commitdiff
hub: Send JSON document for /test handler
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 5 Oct 2022 15:57:39 +0000 (15:57 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 5 Oct 2022 15:57:39 +0000 (15:57 +0000)
The client can only handle JSON and we do not have any reason to change
that.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/hub/handlers.py

index 0d3a944a5f5074307dec581d2342a27417401011..95af230f73c8f993f7da5ef8b1a86261480e4c53 100644 (file)
@@ -103,7 +103,12 @@ class TestHandler(BaseHandler):
        """
        @tornado.web.authenticated
        def get(self):
-               self.write("Hello, %s!\n" % self.current_user)
+               # Send a message which is wrapped into some JSON
+               self.finish({
+                       "message" : [
+                               "Hello, %s!" % self.current_user,
+                       ],
+               })
 
 # Builds