-
-
Notifications
You must be signed in to change notification settings - Fork 199
Encoding::CompatibilityError #304
Comments
Are you getting a stack trace? I'm guessing the exception is occurring in the Griddler email parsing logic. Also, if you (or someone) has had good success using the forked SES adapter, feel free to submit a PR so that the link in the README can be updated |
Thanks @wingrunr21 - it is in the email parsing logic - see the below stack trace. The forked SES adapter is working well outside of the above. I'll make the PR now. Stack Trace
|
@hughkolias I'll be merging the changes from the fork into the upstream branch. The link shouldn't be updated, as my fork will be deprecated. |
@ccallebs I'd rather update the link for the time being. Once the upstream branch is updated again I can change it back |
I've submitted a PR for it - feel free to take whichever approach is best. |
@hughkolias Long story short is that the body that's being presented to Griddler to parse is encoded in I believe the underlying issue is related to the SES adapter decoding the Base64 encoded payload. You can test this yourself: require 'base64'
str = "foobar"
str.encoding #<Encoding:UTF-8>
b64str = Base64.encode64(str)
b64str.encoding #<Encoding:US-ASCII>
Base64.decode64(b64str).encoding #<Encoding:US-ASCII> Also, I just want to make sure you're ok with having posted that email body publicly. There appear to be a few email addresses just in the JSON payload. Not sure what content could be in the message body itself. |
Thanks @wingrunr21 - really appreciate that. I'll forward this to @ccallebs and see if we can modify the gem accordingly (shouldn't be to much work). Thanks for the heads up - i've redacted those, but keeping it there for reference. I'll close out the issue and move it to the SES gem :). |
Has anyone else run into a similar issue when parsing the email body? This might be related to SNS only, but thought I would run it by here to see if anyone else has run into this issue?
Encoding::CompatibilityError: incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string)
I realize it’s erroring in the griddler gem, but it seems to be how it’s passed from the SNS adapter.
I know @ccallebs has a fork and seems to be actively maintaining the new fork.
Here’s the body of the SNS Request:
sns message redacted.
The text was updated successfully, but these errors were encountered: