diff options
author | Claire <claire.github-309c@sitedethib.com> | 2023-08-18 16:06:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-18 16:06:46 +0200 |
commit | e7bea8f004711b34f7abe7b6517adfabe0e5626f (patch) | |
tree | bbd79e40772d23986076a8c5a49fc3fe8a7e551d | |
parent | 6375e390af924649348832d30568e0948871e92b (diff) |
Fix already initialized constant warning (#26542)
-rw-r--r-- | lib/http_extensions.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/http_extensions.rb b/lib/http_extensions.rb index 2bc0618c4c8..048f85f87b8 100644 --- a/lib/http_extensions.rb +++ b/lib/http_extensions.rb @@ -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 |