diff --git a/lib/onelogin/ruby-saml/saml_message.rb b/lib/onelogin/ruby-saml/saml_message.rb index bd88c7e0..c17895cc 100644 --- a/lib/onelogin/ruby-saml/saml_message.rb +++ b/lib/onelogin/ruby-saml/saml_message.rb @@ -19,15 +19,13 @@ class SamlMessage PROTOCOL = "urn:oasis:names:tc:SAML:2.0:protocol".freeze BASE64_FORMAT = %r(\A([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?\Z) - @@mutex = Mutex.new # @return [Nokogiri::XML::Schema] Gets the schema object of the SAML 2.0 Protocol schema # def self.schema - @@mutex.synchronize do - Dir.chdir(File.expand_path("../../../schemas", __FILE__)) do - ::Nokogiri::XML::Schema(File.read("saml-schema-protocol-2.0.xsd")) - end + path = File.expand_path("../../../schemas/saml-schema-protocol-2.0.xsd", __FILE__) + File.open(path) do |file| + ::Nokogiri::XML::Schema(file) end end