Skip to content

Instantly share code, notes, and snippets.

@anchetaWern
Last active June 26, 2019 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anchetaWern/81584f6f70027d5b2bcefc8610c0173b to your computer and use it in GitHub Desktop.
Save anchetaWern/81584f6f70027d5b2bcefc8610c0173b to your computer and use it in GitHub Desktop.
React Native Stream Chat Profanity Filtering: Middleware config
app.use(bodyParser.urlencoded({ extended: false }));
app.use(
bodyParser.text({
type: (req) => {
const is_webhook = req.headers['x-signature'];
if (is_webhook) {
return true;
}
return false;
},
}),
);
app.use(bodyParser.json({
type: (req) => {
const is_webhook = req.headers['x-signature'];
if (is_webhook) {
return false;
}
return true;
}
}));
app.use(cors());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment