1. Alex Willmer
  2. trac-ticketlinks

Commits

jonas  committed d252462

0.1-stable branch: Only try to add form_tokens to text/html output.

  • Participants
  • Parent commits a4d31ef
  • Branches 0.10-stable

Comments (0)

Files changed (1)

File trac/web/api.py

View file
  • Ignore whitespace
             content_type = 'text/plain'
             data = str(self.hdf)
         else:
-            data = self.hdf.render(template, self.form_token)
+            form_token = None
+            if content_type == 'text/html':
+                form_token = self.form_token
+            data = self.hdf.render(template, form_token)
 
         self.send_response(status)
         self.send_header('Cache-control', 'must-revalidate')