Changeset 185 for etherws/trunk


Ignore:
Timestamp:
07/29/12 21:02:39 (12 years ago)
Author:
atzm
Message:
  • fixed a bug, raise exception when controller uses authentication
File:
1 edited

Legend:

Unmodified
Added
Removed
  • etherws/trunk/etherws.py

    r184 r185  
    5353import traceback 
    5454 
     55import tornado 
    5556import websocket 
    5657 
     
    280281 
    281282        def auth_required(): 
    282             self.stream.write(tornado.escape.utf8( 
     283            stream = getattr(self, 'stream', self.request.connection.stream) 
     284            stream.write(tornado.escape.utf8( 
    283285                'HTTP/1.1 401 Authorization Required\r\n' 
    284286                'WWW-Authenticate: Basic realm=etherws\r\n\r\n' 
    285287            )) 
    286             self.stream.close() 
     288            stream.close() 
    287289 
    288290        try: 
Note: See TracChangeset for help on using the changeset viewer.