Skip to content
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

WebhookOptions interface's properties made optional #455

Merged
merged 1 commit into from
Jun 11, 2019
Merged

WebhookOptions interface's properties made optional #455

merged 1 commit into from
Jun 11, 2019

Conversation

khalilchoudhry
Copy link
Contributor

@khalilchoudhry khalilchoudhry commented Jun 9, 2019

Hello,
In the docs, it says to secure Express app by validating incoming Twilio requests with validate property and has used validate property only. The twilio.Webhook() method does not accept validate property alone and gives an error. While if you check it's Javascript code, you can clearly know that all properties are optional and validate is by default true.

Code:

const shouldValidate = process.env.NODE_ENV !== 'test';

app.all('/entrypoint', twilio.webhook({ validate: shouldValidate }), (request, response) => {});

Error:

Argument of type '{ validate: boolean; }' is not assignable to parameter of type 'WebhookOptions'.

Type '{ validate: boolean; }' is missing the following properties from type 'WebhookOptions': includeHelpers, host, protocol

Contributing to Twilio

All third-party contributors acknowledge that any contributions they provide will be made under the same open-source license that the open-source project is provided under.

  • I acknowledge that all my contributions will be made under the project's license.

@khalilchoudhry
Copy link
Contributor Author

@jingming
@kwhinnery
@childish-sambino
Can someone please review this.

Copy link
Contributor

@childish-sambino childish-sambino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@childish-sambino childish-sambino merged commit a5a51ec into twilio:master Jun 11, 2019
@khalilchoudhry khalilchoudhry deleted the fix/make-webhookOptions-properties-optional branch June 12, 2019 20:58
@childish-sambino childish-sambino added the type: bug bug in the library label Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug bug in the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants