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

sendgrid-go inbound.Parse fails with panic when Content-Type is text/html #28

Open
m-terel opened this issue May 19, 2022 · 0 comments · May be fixed by sendgrid/sendgrid-go#460
Open

Comments

@m-terel
Copy link

m-terel commented May 19, 2022

I've set up Inbound Email Parse Webhook. In the webhook I use https://github.com/sendgrid/sendgrid-go lib.

inbound.Parse method fails with a panic for some of the received HTTP requests. It fails when the Content-Type of the received HTTP request is "text/html; charset=utf-8". It works only for multipart content types.

address or nil pointer dereference

goroutine 67 [running]:
runtime/debug.Stack(0xc0003394b8, 0xb5c0c0, 0x1207480)
	/usr/local/go/src/runtime/debug/stack.go:24 +0x9f
github.com/GoogleCloudPlatform/functions-framework-go/funcframework.recoverPanicHTTP(0xd38be0, 0xc0002881c0, 0xc58b92, 0xe)
	/workspace/serverless_function_source_code/vendor/github.com/GoogleCloudPlatform/functions-framework-go/funcframework/framework.go:52 +0x76
panic(0xb5c0c0, 0x1207480)
	/usr/local/go/src/runtime/panic.go:965 +0x1b9
mime/multipart.(*Reader).nextPart(0x0, 0xc00068a300, 0xc0006748d5, 0x18, 0x0)
	/usr/local/go/src/mime/multipart/multipart.go:319 +0x37
mime/multipart.(*Reader).NextPart(...)
	/usr/local/go/src/mime/multipart/multipart.go:306
github.com/sendgrid/sendgrid-go/helpers/inbound.(*ParsedEmail).parseRawEmail(0xc00068a0c0, 0xc000674000, 0x82df, 0x7, 0x126ade0)
	/workspace/serverless_function_source_code/vendor/github.com/sendgrid/sendgrid-go/helpers/inbound/inbound.go:56 +0x375
github.com/sendgrid/sendgrid-go/helpers/inbound.(*ParsedEmail).parse(0xc00068a0c0, 0xc00068a0c0, 0xc0002f7380)
	/workspace/serverless_function_source_code/vendor/github.com/sendgrid/sendgrid-go/helpers/inbound/inbound.go:41 +0x134
github.com/sendgrid/sendgrid-go/helpers/inbound.Parse(0xc000306b00, 0x1, 0xc0002f7408, 0x419d01)
	/workspace/serverless_function_source_code/vendor/github.com/sendgrid/sendgrid-go/helpers/inbound/inbound.go:26 +0x9e
...
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 a pull request may close this issue.

1 participant