Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Better handling of server arguments

  • Loading branch information...
commit e7b6b80ba2044bea1077f78bd53f8c446ad3c895 1 parent 9221f86
Corey Ehmke authored
Showing with 9 additions and 5 deletions.
  1. +9 −5 lib/synack/server.rb
View
14 lib/synack/server.rb
@@ -2,7 +2,7 @@ module Synack
class Server
- attr_accessor :host, :port, :socket
+ attr_reader :host, :port, :socket
# Class methods ================================================================================
@@ -19,14 +19,18 @@ def self.stop
# Instance methods =============================================================================
def initialize(args={})
- self.host = args[:host] || 'localhost'
- self.port = args[:port] || 131313
- self.socket = TCPSocket.open(host, port)
+ @host = args[:host] || 'localhost'
+ @port = args[:port] || 131313
+ @socket = TCPSocket.open(host, port)
end
# FIXME scrub msg to avoid execution of arbitrary commands
+ def sanitize(message)
+ message
+ end
+
def send(message)
- system "/Applications/terminal-notifier.app/Contents/MacOS/terminal-notifier --message message"
+ system "/Applications/terminal-notifier.app/Contents/MacOS/terminal-notifier --message \"#{sanitize(message)}\""
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.