(PUP-5428) Add a query string with the environment when using POST#4400
Conversation
This patch adds a query string with the current environment. Indeed, when the length of the uri is greater than 1024, the GET method is converted to a POST method. All parameters are then stored in the BODY of the request. Putting the environment in the URI allows loadbalancers to redirect requests regarding the environment. This is specific to Puppet 4.x. Using Puppet 3.x, the 1st field of the uri was the environment.
|
This is an intriguing change. It's adding metadata that Puppet will ignore, for use by a load balancer. I assume load balancers can't rely on the POST body because it would be encrypted with HTTPS. I don't see a problem with this change, but the API documentation should be updated. Since it appears the indirector will convert any GET to a POST, I'd add a section in https://github.com/puppetlabs/puppet/blob/master/api/docs/http_api_index.md about it. Also, @cprice404 does this present any problems that you can think of? |
|
Hey Mikael, I didn't see it before, but yes, the documentation says :
In this particular case, when a GET with an uri greater that 1024 is converted in a POST call, this statement becomes false. Olivier |
|
Ah, that should be sufficient for documentation then. |
|
Hello, any updates ? |
|
Hey @olivierHa, with people out for the holidays we haven't been able to get the eyes we need on this change. We'll get back to you as soon as we can. |
|
Ok, got sufficient thumbs up. Let's try it. |
(PUP-5428) Add a query string with the environment when using POST
Hello,
This PR is solving issue https://tickets.puppetlabs.com/browse/PUP-5428.
When the length of the uri is greater that 1024, the GET is converted in POST and all data (environment, facts) are stored in the body request.
Adding a query string when posting allows to loadbalance catalog compilation (for example) to specific puppetserver.
Regards
Olivier