~cytrogen/masto-fe

e7bea8f004711b34f7abe7b6517adfabe0e5626f — Claire 2 years ago 6375e39
Fix already initialized constant warning (#26542)

1 files changed, 3 insertions(+), 5 deletions(-)

M lib/http_extensions.rb
M lib/http_extensions.rb => lib/http_extensions.rb +3 -5
@@ 2,9 2,7 @@

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