Fix Bug 59483 - Fix port parsing from amqp_uri (#529)

* Fix port parsing from amqp_uri

* Correct regex for port parsing
This commit is contained in:
Evgeniy Antonyuk 2022-10-28 16:33:41 +03:00 committed by GitHub
parent a3973583f8
commit d98eb758b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -199,7 +199,7 @@ parse_rabbitmq_url(){
# extract the host # extract the host
local hostport="$(echo ${url/$userpass@/} | cut -d/ -f1)" local hostport="$(echo ${url/$userpass@/} | cut -d/ -f1)"
# by request - try to extract the port # by request - try to extract the port
local port="$(echo $hostport | sed -e 's,^.*:,:,g' -e 's,.*:\([0-9]*\).*,\1,g' -e 's,[^0-9],,g')" local port="$(echo $hostport | grep : | sed -r 's_^.*:+|/.*$__g')"
local host local host
if [ -n "$port" ]; then if [ -n "$port" ]; then