Skip to content

Commit

Permalink
fix(authen): fix invalid URI error
Browse files Browse the repository at this point in the history
- Fix error when pw contain special character
- CGI.escape
  • Loading branch information
longhoangwkm committed Aug 19, 2020
1 parent ca2d4a5 commit 1ebae85
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/katapaty/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ class Configuration

def counterparty_url
return 'http://rpc:[email protected]:14000/api/' unless @host
"#{protocol}://#{@username}:#{@password}@#{@host}:#{@port}/api/"
"#{protocol}://#{@username}:#{CGI.escape(@password)}@#{@host}:#{@port}/api/"
end

def counterblock_url
return 'http://rpc:[email protected]:14100/api/' unless @block_host
authen = ''
authen = "#{@block_username}:#{@block_password}@" if @block_username
authen = "#{@block_username}:#{CGI.escape(@block_password)}@" if @block_username
"#{protocol}://#{authen}#{@block_host}:#{@block_port}/api/"
end

Expand Down

0 comments on commit 1ebae85

Please sign in to comment.