amoeba / TownCrier

Webhook plugin for Decal
MIT License
11 stars 4 forks source link

String escaping isssue #74

Closed amoeba closed 4 years ago

amoeba commented 4 years ago

From Brycter:

7:00 [TownCrier] Error encountered when sending webhook:
0:17:00 [TownCrier] URL: 'https://discordapp.com/api/webhooks/724654274230878269/HCvb5Qj3zzlIew_-bOg7tfznkk85IrQZpXyEdHXUo5vKjGobBIpqDbFFu1Lh5wZfVFqe'
0:17:00 [TownCrier] Payload: '{"content": "7/4/2020 12:16:59 AM [General] Dumbass says, "\cant use""}'
0:17:00 [TownCrier] Error: '{"message": "400: Bad Request", "code": 0}'
0:17:00 [TownCrier] Double-check your URL, Method, and Payload values.

See the imbalanced double quotes.

amoeba commented 4 years ago

Can reproduce a similar issue:

Input: [Fellowship] You say, "cant use\"

Get

7/3/2020 9:20:04 PM: WebhookRequest.SendPOST
7/3/2020 9:20:04 PM:   Url is https://discordapp.com/api/webhooks/531740310674604043/wU1FqslYss6aAlEZ_IPVCHumK53J8hY_BcLVYxjWcpuJwgS4TaI8RIDInYp2zKeSeFy3
7/3/2020 9:20:04 PM:   Payload is { "content": "[Fellowship] Kolthar says \"cant use\\"" }
7/3/2020 9:20:05 PM: {"message": "400: Bad Request", "code": 0}