Skip to content

Inbound Parse: All attachments have Content-Type: text/plain #412

@garydevenay

Description

@garydevenay

Issue Summary

When receiving an attachment via Inbound Parse and using the helper, the content type of all attachments are text/plain. I have tested this with .zip and .jpg files.

I would expect these to be application/zip (or at least application/octet-stream) and image/jpg

Steps to Reproduce

  1. Send email to your inbound address
  2. Use the below code to spit out the content types of attachments.

Code Snippet

func HandleInbound(w http.ResponseWriter, r *http.Request) {
    parsed := inbound.Parse(r)
    for name, contents := range parsed.Attachments {
        contentType := http.DetectContentType(contents)
        fmt.Printf("%v has content type %v", name, contentType)
    }
}

Exception/Log

test.jpg has content type text/plain; charset=utf-8
test.zip has content type text/plain; charset=utf-8

Technical details:

  • sendgrid-go version: v3.6.4
  • go version: 1.15.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions