fog / fog-openstack

Fog for OpenStack Platform
MIT License
68 stars 130 forks source link

Fog::Openstack::Core#request discards headers upon retries #507

Closed avgerin0s closed 4 years ago

avgerin0s commented 4 years ago

This issue seems related to https://github.com/fog/fog-openstack/issues/502 and https://github.com/fog/fog-openstack/issues/501.

After debugging an incident similar to the aforementioned issues I came across f72d2fc which started mutating the params Hash passed by the used in request method (implicitly via the requests classes.

This piece of code will discard the :headers key from the params hash provided by the user on the first request.

In case of a token renewal, for example, the request will the be retried without the headers it used before. Instead it will be dispatched with the default headers (I believe this is why people in the other issues mention wrong Content-Type: application/json).