hakamadare / webservice-pushover

WebService-Pushover - Perl support for Pushover API
http://search.cpan.org/dist/WebService-Pushover
7 stars 6 forks source link

Messages are truncated upon encountering a hash character #7

Closed pjf closed 9 years ago

pjf commented 10 years ago

It seems that anything after (and including) a hash character (#) in a message does not reach the end-client. Either Pushover itself is treating this like a comment, or something is happening in WebService::Pushover that causes this behaviour. (Perhaps hashes need to be encoded somehow?)

I haven't investigated the cause further, but it happens reliably. To reproduce, simply send a message containing a hash character in it somewhere.

hakamadare commented 10 years ago

yup, it's a bug in the module:

$ curl -s -F 'user=USER_TOKEN' -F 'token=APP_TOKEN' -F 'message=before # after' https://api.pushover.net/1/messages.json
{"status":1,"request":"f576c5c64111d3d326672594965b776a"}
$

produces a notification containing 'before # after'.

pjf commented 10 years ago

Same applies for messages containing an ampersand. I'm guessing Pushover needs some sort of encoding.

hakamadare commented 10 years ago

ok, now i'm finally unblocked on this - i ended up needing to capture franckcuny/net-http-spore#35 as a patch for my local Net::HTTP::SPORE package so that i could run the existing WebService::Pushover test suite under Moose 2.12 :( unit test time!

pjf commented 10 years ago

Huzzah! :)

And yes, the updates to Moose caused everything in my world to throw warnings.

I've also noticed we see similar cut-offs with newlines, and I suspect less-than signs as well. I haven't tried encoding things before passing them to Pushover (which would be a workaround), but I'd give it at least a 50/50 chance of working. :)

~ pjf

pjf commented 10 years ago

This is me noting that encoding things before handing them to WebService::Pushover doesn't seem to work. :(