Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fixes #238

Merged
merged 1 commit into from Feb 27, 2019
Merged

Bug fixes #238

Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

bug fixes

  • Loading branch information...
honoki committed Feb 27, 2019
commit 5267b455caeb2e055cccf0d2b6a22727c111f5c3
@@ -12,7 +12,7 @@ def initialize(*args)
end

def data
@data ||= Oj.load(body["data"] || params["data"])
@data ||= Oj.strict_load(body["data"] || params["data"])
end

def body
@@ -87,7 +87,7 @@ def parse_body!
end

def assert_valid_json!(string)
Oj.load(string)
Oj.strict_load(string)
rescue Oj::ParserError
raise Slanger::InvalidRequest.new("Invalid request body: #{raw_body}")
end
@@ -9,7 +9,7 @@ def initialize socket, socket_id=nil
end

def send_message m
msg = Oj.load m
msg = Oj.strict_load m
s = msg.delete 'socket_id'
socket.send Oj.dump(msg, mode: :compat) unless s == socket_id
end
@@ -25,9 +25,9 @@ def initialize(socket, handshake)
# Dispatches message handling to method with same name as
# the event name
def onmessage(msg)
msg = Oj.load(msg)
msg = Oj.strict_load(msg)

msg['data'] = Oj.load(msg['data']) if msg['data'].is_a? String
msg['data'] = Oj.strict_load(msg['data']) if msg['data'].is_a? String

event = msg['event'].gsub(/\Apusher:/, 'pusher_')

@@ -32,7 +32,7 @@ def initialize(attrs)
end

def subscribe(msg, callback, &blk)
channel_data = Oj.load msg['data']['channel_data']
channel_data = Oj.strict_load msg['data']['channel_data']
public_subscription_id = SecureRandom.uuid

# Send event about the new subscription to the Redis slanger:connection_notification Channel.
@@ -25,7 +25,7 @@ def publisher
def subscriber
@subscriber ||= new_connection.pubsub.tap do |c|
c.on(:message) do |channel, message|
message = Oj.load(message)
message = Oj.strict_load(message)
c = Channel.from message['channel']
c.dispatch message, channel
end
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.