Skip to content

Commit

Permalink
tmp fix for ws
Browse files Browse the repository at this point in the history
  • Loading branch information
noraj committed Apr 20, 2023
1 parent fae6be9 commit 3fa654d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/ctf_party/defang.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ def defang_uri
puts e
return gsub('.', '[.]')
end
begin
# temporary fix until backport for ruby 3.0 https://github.com/ruby/ruby/pull/7260
# rubocop:disable Lint/Void
URI::WS
URI::WSS
# rubocop:enable Lint/Void
rescue NameError => e
puts e
require 'uri/ws'
require 'uri/wss'
end
case uri
when URI::HTTP, URI::HTTPS, URI::FTP
uri.scheme = uri.scheme.gsub(/t/i, 'x')
Expand Down

0 comments on commit 3fa654d

Please sign in to comment.