edgurgel/poxa

REST API error

tgmweb opened this issue · 2 comments

I'm getting an error when using the REST API. Switching my API calls from poxa to api.pusherapp.com works - so I don't think I'm doing anything wrong.

Error I receive in poxa is below:

01:46:50.938 [error] Ranch listener :poxa_http, connection process #PID<0.1499.0>, stream 1 had its request process #PID<0.1500.0> exit with reason :badarg and stacktrace [{:erlang, :list_to_integer, ['1574905610.925'], []}, {Signaturex, :validate_timestamp!, 2, [file: 'lib/signaturex.ex', line: 47]}, {Signaturex, :validate!, 6, [file: 'lib/signaturex.ex', line: 16]}, {Signaturex, :validate, 6, [file: 'lib/signaturex.ex', line: 31]}, {Poxa.EventHandler, :is_authorized, 2, [file: 'lib/poxa/event_handler.ex', line: 55]}, {:cowboy_rest, :call, 3, [file: '/home/ec2-user/poxa/deps/cowboy/src/cowboy_rest.erl', line: 1576]}, {:cowboy_rest, :is_authorized, 2, [file: '/home/ec2-user/poxa/deps/cowboy/src/cowboy_rest.erl', line: 372]}, {:cowboy_rest, :upgrade, 4, [file: '/home/ec2-user/poxa/deps/cowboy/src/cowboy_rest.erl', line: 288]}]

It looks like it doesn't like my API call, but "badarg" isn't all that useful. As I said if I switch the URL from localhost:8080 to api.pusherapp.com it works without issue.

Any idea how I can troubleshoot this?

ok - this is resolved. Seems pusher API is a ok with the timestamp being a float (when it should be an int) - just me being a dumbass!

Thanks for reporting back!