Skip to content

Commit

Permalink
fix(bus): fallback on decoding uri (#91)
Browse files Browse the repository at this point in the history
closes #90
  • Loading branch information
derevnjuk authored Sep 11, 2020
1 parent 14acd7b commit e9ab6e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Bus/Brokers/RabbitMQBus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,9 @@ export class RabbitMQBus implements Bus {
private async createConsumerChannel(): Promise<void> {
if (!this.channel) {
this.channel = await this.client.createConfirmChannel();
this.channel.on('error', (reason: Error) =>
logger.error('Unexpected error: %s', reason)
);
await this.bindExchangesToQueue(this.channel);
await this.startBasicConsume(this.channel);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/Helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class Helpers {
try {
decodedStr = decodeURI(str);
} catch {
throw new Error(`Malformed URI sequence: ${str}`);
decodedStr = str;
}

return encodeURI(decodedStr).replace(/%5B/g, '[').replace(/%5D/g, ']');
Expand Down

0 comments on commit e9ab6e0

Please sign in to comment.