Skip to content

Commit

Permalink
Fixed issue on incoming webhooks that caused the content raw to not b…
Browse files Browse the repository at this point in the history
…e available (#10258)
  • Loading branch information
Hudell authored and rodrigok committed Apr 3, 2018
1 parent 39833fa commit b0d297d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/rocketchat-integrations/server/api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ function executeIntegrationRest() {
return RocketChat.API.v1.failure(e.message);
}

this.request.setEncoding('utf8');
const content_raw = this.request.read();

const request = {
url: {
hash: this.request._parsedUrl.hash,
Expand All @@ -196,7 +199,7 @@ function executeIntegrationRest() {
url_raw: this.request.url,
url_params: this.urlParams,
content: this.bodyParams,
content_raw: this.request._readableState && this.request._readableState.buffer && this.request._readableState.buffer.toString(),
content_raw,
headers: this.request.headers,
user: {
_id: this.user._id,
Expand Down

0 comments on commit b0d297d

Please sign in to comment.