Skip to content

Commit e2f6f7b

Browse files
committed
11
1 parent 3b8dcea commit e2f6f7b

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

OpenFlow/src/amqpwrapper.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -381,14 +381,16 @@ export class amqpwrapper {
381381
Math.random().toString() +
382382
Math.random().toString();
383383
}
384-
385-
386-
387-
parseurl(amqp_url): url.URL {
388-
var q: url.URL = url.parse(amqp_url, true) as any;
389-
if (q.username == null || q.username == "") { q.username = "guest"; }
390-
if (q.password == null || q.password == "") { q.password = "guest"; }
384+
parseurl(amqp_url): url.UrlWithParsedQuery {
385+
var q = url.parse(amqp_url, true);
386+
(q as any).username = "guest";
387+
(q as any).password = "guest";
391388
if (q.port == null || q.port == "") { q.port = "15672"; }
389+
if (q.auth != null && q.auth != "") {
390+
var arr = q.auth.split(':');
391+
(q as any).username = arr[0];
392+
(q as any).password = arr[1];
393+
}
392394
q.protocol = 'http://';
393395
return q;
394396
}

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.32
1+
1.0.33

0 commit comments

Comments
 (0)