Skip to content

Commit

Permalink
Automatically detect the fastest XML parser
Browse files Browse the repository at this point in the history
This should use libxml2 if available, and fall back to rexml otherwise.
Recent version of rexml have a tag limit to mitigate some DoS attacks,
which can easily be reached with the verbosity of XML-RPC.
  • Loading branch information
qnet-herwin committed Sep 4, 2024
1 parent 33b4723 commit 38284a6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/xmlrpc/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ module Config
#
# * XMLParser::REXMLStreamParser
# * XMLParser::LibXMLStreamParser
DEFAULT_PARSER = XMLParser::REXMLStreamParser
begin
DEFAULT_PARSER = XMLParser::LibXMLStreamParser.new.class
rescue LoadError
DEFAULT_PARSER = XMLParser::REXMLStreamParser.new.class
end

# enable <code><nil/></code> tag
ENABLE_NIL_CREATE = false
Expand Down

0 comments on commit 38284a6

Please sign in to comment.