diff options
author | Christian Hofstaedtler <ch+git@zeha.at> | 2009-07-02 09:45:15 +0200 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-07-05 18:40:44 +1000 |
commit | 325b8e4f6f21341d0c8d04297b019db47af2abc6 (patch) | |
tree | 8d067ccefcacbfdecd5e70d1f7741c073ccee693 | |
parent | 46112daf979c71fb004d51289096ae37561d23bb (diff) | |
download | puppet-325b8e4f6f21341d0c8d04297b019db47af2abc6.tar.gz puppet-325b8e4f6f21341d0c8d04297b019db47af2abc6.tar.xz puppet-325b8e4f6f21341d0c8d04297b019db47af2abc6.zip |
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.
-rw-r--r-- | lib/puppet/network/http/rack.rb | 3 |
1 files changed, 2 insertions, 1 deletions
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 |