mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 18:31:57 +03:00
b7a092a24a
refs https://github.com/TryGhost/Ghost/issues/12610 refs https://github.com/mailgun/mailgun-js-boland/blob/v0.22.0/lib/request.js#L285-L333 The mailgun domain is used by the mailgun API to construct the URL for the API. e.g for a domain of "mg.example.com" the URL for the API messages would look like: https://api.mailgun.net/v3/mg.example.com/messages One weird thing about the mailgun API is that if the path does not map to an API endpoint, then instead of a 404, we get a 200, with a body of "Mailgun Magnificent API". The `mailgun-js` library which we use, expects a JSON response, and will return a body of undefined if it does not get one. This all resulted in us trying to read the property `id` of an undefined `body` variable. The fix here is to reject the containing Promise, if there is no body. So that the default error handling will kick in. |
||
---|---|---|
.. | ||
index.js | ||
mailgun.js |