From 325b8e4f6f21341d0c8d04297b019db47af2abc6 Mon Sep 17 00:00:00 2001 From: Christian Hofstaedtler Date: Thu, 2 Jul 2009 09:45:15 +0200 Subject: Fix #2383, an incompatibility with early ruby 1.8 versions Earlier ruby 1.8 versions do not have start_with? for Strings. Found by John Barbuto. --- lib/puppet/network/http/rack.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/puppet/network/http/rack.rb b/lib/puppet/network/http/rack.rb index 6eab27a07..756b66814 100644 --- a/lib/puppet/network/http/rack.rb +++ b/lib/puppet/network/http/rack.rb @@ -15,6 +15,7 @@ class Puppet::Network::HTTP::Rack protocols.delete :rest # Prepare the XMLRPC handler, for backward compatibility (if requested) + @xmlrpc_path = '/RPC2' if args[:protocols].include?(:xmlrpc) raise ArgumentError, "XMLRPC was requested, but no handlers were given" if !args.include?(:xmlrpc_handlers) @@ -36,7 +37,7 @@ class Puppet::Network::HTTP::Rack Puppet.debug 'Handling request: %s %s' % [request.request_method, request.fullpath] # if we shall serve XMLRPC, have /RPC2 go to the xmlrpc handler - if @xmlrpc_http_handler and request.path_info.start_with?('/RPC2') + if @xmlrpc_http_handler and @xmlrpc_path == request.path_info[0, @xmlrpc_path.size] handler = @xmlrpc_http_handler else # everything else is handled by the new REST handler -- cgit