cliffano / nestor

Jenkins CLI and node.js client
http://blog.cliffano.com/tag/nestor/
MIT License
181 stars 27 forks source link

Redirect handlers for `build` #45

Closed gillesdemey closed 7 years ago

gillesdemey commented 7 years ago

Haven't dug into this too deep, but when our Jenkins deployment responded with a 301 nestor threw a jobRequireParamsError back at me.

I suspect that both 301 and 302 responses need a passThroughResponse similar to https://github.com/cliffano/nestor/blob/b9da38ea3a98d0420c9909bb9c7d94fc3e06f3a8/lib/api/job.js#L104-L105 but haven't been able to verify this yet.

Executing the job manually with curl verifies that a 301 is returned but follows up with a 200 and not a 405.

cliffano commented 7 years ago

@gillesdemey Nestor should follow redirect 301 and 302 as per https://github.com/cliffano/bagofrequest/blob/master/lib/bagofrequest.js#L34 . If the redirect points you to 405, I suspect it's due to the method.

What is the exact nestor command that you executed?

Could you also please provide the following information:

node.js version: node --version npm version: npm --version Nestor version: nestor --version Jenkins version: nestor ver

gillesdemey commented 7 years ago

Seems that I can no longer reproduce this issue, maybe one of the Jenkins plugins were to blame :)

cliffano commented 7 years ago

@gillesdemey Thanks for checking it again.