mreinstein / alexa-verifier

✓ Verify HTTP requests sent to an Alexa skill are sent from Amazon
MIT License
76 stars 23 forks source link

adding test case for verify data with double byte utf-8 characters #21

Closed l33way closed 7 years ago

l33way commented 7 years ago

adding a test for requests with double byte utf-8 chars.. I did not want to modify the signature of the verifier to add an encoding option since this would be a breaking change. however i can confirm that alexa is passing the utf-8 charset in the content-type header. Ill let you guys make the determination if you want to modify the signature to accept an optional body encoding parameter.

Here is the header from Alexa for reference: "content-type":"application/json; charset=utf-8"

cheers!

dblock commented 7 years ago

Thanks! Since @mreinstein hasn't taken my r/w permissions away yet i'm going to make the executive decision of merging this.

Regarding the header, in theory the right way of handing this would be to get the charset from the request header and use that in case Amazon changes this one day. But I am being a purist, I don't expect that to actually happen.