Skip to content

Comments

(PUP-5428) Add a query string with the environment when using POST#4400

Merged
MikaelSmith merged 1 commit intopuppetlabs:masterfrom
olivierHa:fix/master/add_env_using_post
Dec 15, 2015
Merged

(PUP-5428) Add a query string with the environment when using POST#4400
MikaelSmith merged 1 commit intopuppetlabs:masterfrom
olivierHa:fix/master/add_env_using_post

Conversation

@olivierHa
Copy link
Contributor

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

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.
@MikaelSmith
Copy link
Contributor

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?

@olivierHa
Copy link
Contributor Author

Hey Mikael,

I didn't see it before, but yes, the documentation says :

Every HTTP endpoint that dispatches to the indirector follows the form: /puppet/v3/:indirection/:key?environment=:environment

In this particular case, when a GET with an uri greater that 1024 is converted in a POST call, this statement becomes false.

Olivier

@MikaelSmith
Copy link
Contributor

Ah, that should be sufficient for documentation then.

@olivierHa
Copy link
Contributor Author

Hello, any updates ?

@HAIL9000
Copy link
Contributor

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.

@HAIL9000 HAIL9000 added Triaged blocked PRs blocked on work external to the PR itself and removed Pending Triage labels Nov 24, 2015
@MikaelSmith
Copy link
Contributor

Ok, got sufficient thumbs up. Let's try it.

MikaelSmith pushed a commit that referenced this pull request Dec 15, 2015
(PUP-5428) Add a query string with the environment when using POST
@MikaelSmith MikaelSmith merged commit d78aefb into puppetlabs:master Dec 15, 2015
@joshcooper joshcooper removed the blocked PRs blocked on work external to the PR itself label Feb 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants