File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,12 @@ def parse_args_http(args = [], type = 'http')
127
127
when '-o'
128
128
options [ :output_file ] = File . expand_path ( val )
129
129
when '-u'
130
- options [ :auth_username ] = val
130
+ val = val . split ( ':' , 2 ) # only split on first ':' as per curl:
131
+ # from curl man page: "The user name and passwords are split up on the
132
+ # first colon, which makes it impossible to use a colon in the user
133
+ # name with this option. The password can, still.
134
+ options [ :auth_username ] = val . first
135
+ options [ :auth_password ] = val . last
131
136
when '-p'
132
137
options [ :auth_password ] = val
133
138
when '-X'
@@ -186,8 +191,6 @@ def handle_request_http(opts, opt_parser)
186
191
print_error ( 'The connection was reset by the peer' )
187
192
rescue ::EOFError , Errno ::ETIMEDOUT , Rex ::ConnectionError , ::Timeout ::Error
188
193
print_error ( 'Encountered an error' )
189
- #rescue ::Exception => ex
190
- # print_line("An error of type #{ex.class} happened, message is #{ex.message}")
191
194
ensure
192
195
http_client . close
193
196
end
You can’t perform that action at this time.
0 commit comments