How to configure python tornado application to give back a crossdomain.xml?

329 views Asked by At

So as far as I know first step shoud be create some response class in main application which is link with some url pattern. For example:

(r'/crossdomain.xml', GrahhHandler)

then in second step we should some way return crossdomail.xml document when we call GrahhHanler get function

class GrahhHandler (web.RequestHandler):
    def get():
        return self.render('crossdomain.xml')

But I have 500: Internal Server Error after configuring GrahhHandler such way

TypeError: get() takes 0 positional arguments but 1 was given ERROR:tornado.access:500 GET /crossdomain.xml (127.0.0.1) 25.00ms

Please help me to configure GrahhHandler to get back a real crossdomain.xml

1

There are 1 answers

0
Oliver On

Set the proper content-type header for xml just before the render() call:

self.set_header("Content-Type", "text/xml")