Fix already initialized constant warning (#26542)

This commit is contained in:
Claire 2023-08-18 16:06:46 +02:00 committed by GitHub
parent 6375e390af
commit e7bea8f004
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,9 +2,7 @@
# Monkey patching until https://github.com/httprb/http/pull/757 is merged # Monkey patching until https://github.com/httprb/http/pull/757 is merged
unless HTTP::Request::METHODS.include?(:purge) unless HTTP::Request::METHODS.include?(:purge)
module HTTP methods = HTTP::Request::METHODS.dup
class Request HTTP::Request.send(:remove_const, :METHODS)
METHODS = METHODS.dup.push(:purge).freeze HTTP::Request.const_set(:METHODS, methods.push(:purge).freeze)
end
end
end end