RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: davidhq
this should be so:
def incoming(message, callback) if message['channel'] !~ %r{^/meta/} if message['ext'].nil? || message['ext']['auth_token'] != FAYE_TOKEN message['error'] = 'Invalid authentication token' end end callback.call(message) end
we have to check for message['ext'].nil? because if we don't and someone sends a request without the auth token, the server crashes.
this should be so:
we have to check for message['ext'].nil? because if we don't and someone sends a request without the auth token, the server crashes.