This repository has been archived by the owner on Sep 29, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(adapter): escape reply message, reconnect datafeed on error
xml characters in a reply are escaped to avoid creating invalid messageML if an error is encountered polling a datafeed a new one will be created
- Loading branch information
1 parent
b4748a6
commit 79fc121
Showing
4 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,3 +101,21 @@ describe 'Adapter test suite', () -> | |
assert.isAtLeast((m for m in nock.messages when m.message is "<messageML><mention email=\"[email protected]\"/> foo bar baz</messageML>").length, 1) | ||
done() | ||
adapter.run() | ||
|
||
it 'should escape xml chars in reply', (done) -> | ||
robot = new FakeRobot | ||
adapter = SymphonyAdapter.use(robot) | ||
adapter.on 'connected', () -> | ||
assert.isDefined(adapter.symphony) | ||
envelope = { | ||
room: nock.streamId | ||
user: { | ||
emailAddress: '[email protected]' | ||
} | ||
} | ||
adapter.reply(envelope, '<&>') | ||
adapter.close() | ||
nock.on 'received', () -> | ||
assert.isAtLeast((m for m in nock.messages when m.message is "<messageML><mention email=\"[email protected]\"/> <&></messageML>").length, 1) | ||
done() | ||
adapter.run() |