lib/scout/server.rb in scout-5.1.3 vs lib/scout/server.rb in scout-5.1.4

- old
+ new

@@ -17,13 +17,13 @@ class PluginTimeoutError < RuntimeError; end # A new class for API Timeout errors. class APITimeoutError < RuntimeError; end # Headers passed up with all API requests. - HTTP_HEADERS = { "CLIENT_VERSION" => Scout::VERSION, - "CLIENT_HOSTNAME" => Socket.gethostname, - "ACCEPT_ENCODING" => "gzip" } + HTTP_HEADERS = { "Client-Version" => Scout::VERSION, + "Client-Hostname" => Socket.gethostname, + "Accept-Encoding" => "gzip" } # # A plugin cannot take more than DEFAULT_PLUGIN_TIMEOUT seconds to execute, # otherwise, a timeout error is generated. This can be overriden by # individual plugins. @@ -65,11 +65,11 @@ # 1) it sets the @plugin plan with either A) whatever is in history, B) the results of the /plan retrieval # 2) it sets @checkin_to = true IF so directed by the scout server def fetch_plan url = urlify(:plan) info "Pinging server at #{url}..." - headers = {"x_scout_tty" => ($stdin.tty? ? 'true' : 'false')} + headers = {"x-scout-tty" => ($stdin.tty? ? 'true' : 'false')} if @history["plan_last_modified"] and @history["old_plugins"] headers["If-Modified-Since"] = @history["plan_last_modified"] end get(url, "Could not retrieve plan from server.", headers) do |res| if res.is_a? Net::HTTPNotModified @@ -389,11 +389,11 @@ gzip.close post( urlify(:checkin), "Unable to check in with the server.", io.string, "Content-Type" => "application/json", - "CONTENT_ENCODING" => "gzip" ) + "Content-Encoding" => "gzip" ) rescue Exception error "Unable to check in with the server." debug $!.class.to_s debug $!.message debug $!.backtrace @@ -415,6 +415,6 @@ else super end end end -end \ No newline at end of file +end