Last active
June 26, 2019 05:58
-
-
Save anchetaWern/81584f6f70027d5b2bcefc8610c0173b to your computer and use it in GitHub Desktop.
React Native Stream Chat Profanity Filtering: Middleware config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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