Changeset 287
- Timestamp:
- 12/05/16 19:04:28 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
etherws/trunk/etherws.py
r281 r287 416 416 IFOP_ALLOWED = False 417 417 418 def __init__(self, app, req, switch, htpasswd, logger, debug):418 def __init__(self, app, req, switch, htpasswd, noorigin, logger, debug): 419 419 super(ServerHandler, self).__init__(app, req) 420 420 self._switch = switch 421 421 self._htpasswd = htpasswd 422 self._noorigin = noorigin 422 423 self._logger = logger 423 424 self._debug = debug … … 444 445 self._switch.unregister_port(self) 445 446 self._logger.info('disconnected: %s', self.request.remote_ip) 447 448 def check_origin(self, origin): 449 if self._noorigin: 450 return True 451 return super(ServerHandler, self).check_origin(origin) 446 452 447 453 … … 728 734 if not isinstance(cred, dict): 729 735 return {} 730 if 'user' not in cred:736 if cred.get('user') is None: 731 737 return {} 732 if 'passwd' not in cred:738 if cred.get('passwd') is None: 733 739 return {} 734 740 … … 1030 1036 'switch': switch, 1031 1037 'htpasswd': args.htpasswd, 1038 'noorigin': args.noorigin, 1032 1039 'logger': logger, 1033 1040 'debug': args.debug, … … 1048 1055 'switch': switch, 1049 1056 'htpasswd': args.htpasswd, 1057 'noorigin': args.noorigin, 1050 1058 'logger': logger, 1051 1059 'debug': args.debug, … … 1264 1272 help='path to SSL certificate for control API') 1265 1273 1274 parser_sw.add_argument('--noorigin', action='store_true', default=False, 1275 help='do not check origin header') 1276 1266 1277 # - ctl 1267 1278 parser_ctl = subcommand.add_parser('ctl',
Note: See TracChangeset
for help on using the changeset viewer.