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

fix: panic on webhook with nil body #1890

Merged
merged 3 commits into from
Oct 29, 2021

Conversation

NickUfer
Copy link
Contributor

@NickUfer NickUfer commented Oct 26, 2021

Related issue(s)

Fixes #1885 by ensuring the body reader is never nil. See golang/go#32897

Checklist

Further Comments

@NickUfer NickUfer changed the title fix: panic on webhook with empty body fix: panic on webhook with nil body Oct 26, 2021
Copy link
Member

@aeneasr aeneasr left a comment

Choose a reason for hiding this comment

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

Nice find :)

Could you maybe also add a test case for this, to ensure there are no regressions?

selfservice/hook/web_hook.go Outdated Show resolved Hide resolved
@aeneasr
Copy link
Member

aeneasr commented Oct 27, 2021

Justin case you missed this:

Could you maybe also add a test case for this, to ensure there are no regressions?

:)

@NickUfer
Copy link
Contributor Author

Hope this test is enough, didn't know how I should test the webhook execute function in any good way

@aeneasr aeneasr merged commit 4bf1825 into ory:master Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hook runtime error: invalid memory address or nil pointer dereference
2 participants