Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OutboundMessage doesn't escape the newline in JSON #5

Open
yllan opened this issue Aug 4, 2015 · 0 comments
Open

OutboundMessage doesn't escape the newline in JSON #5

yllan opened this issue Aug 4, 2015 · 0 comments

Comments

@yllan
Copy link

yllan commented Aug 4, 2015

https://github.com/ScalaConsultants/scala-slack-bot-core/blob/master/src/main/scala/io/scalac/slack/common/Messages.scala#L52

If the text contains newline or ", it will break the JSON format.

Example:

val response = OutboundMessage(message.channel, s"""ha","escape":"bad""")
publish(response)

Expected Payload:

{
"id": 1,
"type": "message",
"channel": "D08GG2WJF",
"text": "ha\",\"escape\":\"bad"
} 

Actual Payload:

{
"id": 1,
"type": "message",
"channel": "D08GG2WJF",
"text": "ha","escape":"bad"
} 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant