Skip to content

Instantly share code, notes, and snippets.

@genki
Created January 30, 2009 06:13
Show Gist options
  • Save genki/54954 to your computer and use it in GitHub Desktop.
Save genki/54954 to your computer and use it in GitHub Desktop.
module Merb
class Request
def message
return {} unless params[:_message]
begin
Marshal.load(params[:_message].unpack("m").first)
rescue ArgumentError, TypeError
{}
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment