Commits

Ginés Martínez Sánchez  committed 4cbefdc Draft

XhrPolling test sockjs passed!

  • Participants
  • Parent commits ddf1998

Comments (0)

Files changed (1)

File ginsfsm/protocols/sockjs/server/transports/xhr.py

 
     def post(self):
         response = self.set_response(self.request.response)
-        print "XXXXXXXXXXXXXXXXXXXXX"
         # Start response
         self.preflight()
         self.handle_session_cookie()
             return response  # HTTPServerError("Error, no session.")
 
         if not self.session.send_queue:
-            print "HEARTTTTTTTTTTTTTTT"
+            print ">>>>>>>SEND_QUEUE"
             self.session.start_heartbeat()
         else:
-            print "FLUSHHHHHHHHHHHHHHHHHH"
+            print ">>>>>>>FLUSHHH"
             self.session.flush()
 
         return response
         self.active = False
 
         try:
-            self.content_type = 'application/javascript'
-            self.charset = 'UTF-8'
+            self.response.content_type = 'application/javascript'
+            self.response.charset = 'UTF-8'
+
             print "zzzzz", message
             self.add_body(message + '\n')
             self.flush(callback=self.send_complete)
         except Exception:
             logging.exception('XHR incoming')
             session.close()
-            return HTTPServerError()
+            return HTTPServerError('XHR incoming')
 
         self.set_status(204)
-        self.content_type = 'text/plain'
-        self.charset = 'UTF-8'
+        self.response.content_type = 'text/plain'
+        self.response.charset = 'UTF-8'
         return response