Skip to content

Commit

Permalink
remove Dir.chdir
Browse files Browse the repository at this point in the history
  • Loading branch information
e-ikuta committed Oct 22, 2024
1 parent 21b676b commit a1f2f7d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/onelogin/ruby-saml/saml_message.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit a1f2f7d

Please sign in to comment.