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

detect and either error out or fixup trying to use newlines in headers in the http injection api #296

Open
wez opened this issue Sep 27, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@wez
Copy link
Collaborator

wez commented Sep 27, 2024

We had a user report issues when trying to do this:

{
  "envelope_sender": "ok@example",
  "content": {
    "subject": "hello\n\nHello there",
    "html_body": "<html>This is the HTML content of the message</html>",
    "text_body": "This is the Text content of the message",
    "from": {
      "email": "[email protected]",
      "name": "Test"
    },
    "headers": {
      "X-Tenant": "tenant"
    }
  },
  "recipients": [
    {
      "email": "[email protected]"
    }
  ]
}

the newlines in the subject caused the message body to start in the wrong place and caused issues with the tenant header seemingly not being present.

We should either raise an error for this case, or automatically fixup the newlines in the input so that the header value cannot escape and break the message.

Whichever we choose, we should apply it both to the subject header and any other arbitrary headers that are being passed into the builder.

@wez wez added the enhancement New feature or request label Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant