-
Notifications
You must be signed in to change notification settings - Fork 7
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
Different payloads received for dev and prod environment? #19
Comments
@SimonLab which version of Elixir are you running on your Localhost vs. Heroku? |
Localhost: Elixir 1.3.4 from elixir_buildpack:
The phoenix version is defined on the mix.exs and is |
Not a blocker anymore as I'm creating a switch to parse the payload properly depending on its format. But I still would like to understand the source of the problem 😟 |
@SimonLab this should be included in the readme/instructions for setting up web hooks... |
Some context: Each time an event appears on Github (new label, new issue,...) my server receive a POST request from Github with all the information of the event store in the payload (body) of the request. The format of the paylod seems however different on my loacalhost and on Heroku:
On Heroku the payload received is already parse to Json:
On localhost the payload as the following format:
The the first one is a json object, the second one is also a json object but with just one property "payload" which has for value the stringify response.
Which means that on localhost I need to use Poinon.decode to parse the value but this will break on production has the value is already parsed.
I've also deploy an hapi server on Heroku to see the format of the payload and it match the second version;
I'm not entirely sure why this difference exists and where it comes form, is it the way Github send the payload? Is it an option on Phoenix to parse automatically the payload on production but not on developement? Does anyone has any suggestion to help me understand how Phoenix manage the payload of a post request and why there is this difference in the format of the payload?
The text was updated successfully, but these errors were encountered: