-
-
Notifications
You must be signed in to change notification settings - Fork 743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Content-Encoding issue #100
Comments
You can always add the following prior to invoking the body parser middleware: app.use(function (req, res, next) {
delete req.headers['content-encoding']
next()
}) and of course you can always wrap that delete in an
So we could potentially make this error optional. |
Thanks for the quick response. I'll be sure to give this a try tomorrow. Hopefully there is a way to insert this middleware before the body parser runs. |
Hm, I see. Looking at https://github.com/github/hubot/blob/5ec8f375f3ac97e9df6e45c6b459d42025b74694/src/robot.coffee it seems pretty self-contained, so if this is possible, it's not going to be simple. Even then, if I add a configuration here, you'll still have to get |
After reviewing hubot's code I believe you're right. They really need to add a way to insert middleware before they add their own, for cases like this. I might look at submitting a PR for that functionality. I don't believe there are any issues with the way expressjs is handling that Content-Encoding header. Per the spec, Content-Encoding: UTF-8 doesn't make any sense anyway. Thank you for your cooperation and guidance. I believe we can close this ticket and i'll move this conversation over to the hubot repo. |
So, I meant to do this earlier, but kept forgetting: I added an issue #108 that would, in situations like this, allow you to add a custom content encoding hook. For instance, you would eventually be able to theoretically add a hook for |
I've got an application that is sending webhooks to hubot. I receive the error pasted below. Unfortunately the app is sending webhooks with a header of Content-Encoding: UTF-8 and there is nothing I can do on that end. I can change hubot however I need to though. Is there a way to get express/body-parser to "ignore" the Content-Encoding header?
This used to work with an older version of hubot. I just recently upgraded and i'm now hitting this error. Any help or direction would be appreciated.
The text was updated successfully, but these errors were encountered: