Closed davidlaprade closed 6 years ago
@bricesanchez @AlessioRocco Friendly ping on this :)
Test failures don't seem to be related to this code. It's whatever is causing the failures on master.
This actually seems to be the cause of the test failures (here and on master): https://github.com/nebulab/cangaroo/commit/c1f5b39c06eab0a19af88d4102bfa0a53527c713
Prior to this commit, all my tests pass via bundle exec appraisal rspec
, after it, I start getting failures. It appears that using the non-positional #post
method -- i.e. passing a hash with headers: {}, params: {}
to the #post
method -- wipes the headers of the headers["Content-Type"] == "application/json"
, substituting it with "application/x-www-form-urlencoded"
Confirmed: this fixes the test failures: https://github.com/nebulab/cangaroo/pull/60
@bricesanchez @AlessioRocco
Can I get an update on this? Is there anything this needs to get it merged in? Thanks!
@davidlaprade, merged, thanks!
We currently send along the X_HUB_TOKEN as a header for requests to endpoints:
This makes sense, since the spree/endpoint_base uses X_HUB_TOKEN for authorization:
Unfortunately, use of underscores in HTTP headers is a legacy feature, requiring explicit, non-default configurations on the most common ruby web servers: nginx and apache.
From the NGinx docs:
And the docs for recent versions of Apache:
Sending along both
HTTP_X_HUB_TOKEN
andHTTP-X-HUB-TOKEN
should improve compatibility for a majority of users.