a1a480eb63252c5f2fb070ba60e487751bedca64,dino/validation/request.py,RequestValidator,on_message,#RequestValidator#Any#,35
Before Change
if message is None or len(message.strip()) == 0:
return False, 400, "empty message body"
try:
str(base64.b64decode(bytes(message, "utf-8")), "utf-8")
except Exception as e:
logger.warning("invalid message content, could not decode base64: %s" % str(e))
return False, 400, "invalid message content, not base64 encoded"
if room_id is None or room_id == "":
return False, 400, "no room id specified when sending message"
if object_type not in ["room", "private"]:
After Change
if message is None or len(message.strip()) == 0:
return False, 400, "empty message body"
if not self._is_base64(message):
return False, 400, "invalid message content, not base64 encoded"
if room_id is None or room_id == "":
return False, 400, "no room id specified when sending message"
if object_type not in ["room", "private"]:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: thenetcircle/dino
Commit Name: a1a480eb63252c5f2fb070ba60e487751bedca64
Time: 2016-11-10
Author: oscar.eriks@gmail.com
File Name: dino/validation/request.py
Class Name: RequestValidator
Method Name: on_message
Project Name: NervanaSystems/nlp-architect
Commit Name: 24d3656c6c4b3c6806954487720d53af775a1150
Time: 2018-06-07
Author: shira.guskin@intel.com
File Name: set_expansion_demo/ui/main.py
Class Name:
Method Name: get_phrases
Project Name: NervanaSystems/nlp-architect
Commit Name: 24d3656c6c4b3c6806954487720d53af775a1150
Time: 2018-06-07
Author: shira.guskin@intel.com
File Name: set_expansion_demo/ui/main.py
Class Name:
Method Name: get_expand_results_callback