diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2017-07-20 10:25:19 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2017-07-20 10:25:19 -0700 |
commit | df6dd3768d5fcc99a348bd52d7e6ffeaa1c391db (patch) | |
tree | 8e79fe5fd7b9102ed71a8a731b1492f4d1bd212c /Gemfile | |
parent | 020c42b59503692742e6298a35d1bf4b1d2b491c (diff) | |
download | chef-df6dd3768d5fcc99a348bd52d7e6ffeaa1c391db.tar.gz |
fix retries on JSON POST requests when negotiating protocol version
on the first pass through the JSON middleware it encodes the
body. if there's a retry, it re-encodes the body as a string
with all its metacharacters escaped.
this is a particular issue when doing a first request that is
a POST that requires negotiating the API version. when doing a
GET it isn't a problem because there's no body payload -- but a
POST or a PUT which requires a retry will get garbled and will
cause a 500.
this happens on hosted right now if trying to POST with a v2
API since hosted is only v1, so there's a retry to downgrade.
i also made the same kind of changes to the streaming download
requests, but since they're GETs its unclear to me if there was
any impact there -- but middleware could have been double-mangling
headers on a retry.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'Gemfile')
-rw-r--r-- | Gemfile | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -50,6 +50,7 @@ end group(:development, :test) do gem "rake" gem "simplecov" + gem "webmock" # for testing new chefstyle rules # gem 'chefstyle', github: 'chef/chefstyle' |