Commit 68b14e4
fix: Set browser User-Agent for Jenkins requests
Jenkins servers behind a WAF/CDN such as Cloudflare reject the default
python-requests/python-jenkins User-Agent as suspected bot traffic,
causing commands like "lftools jenkins get-credentials" to fail with a
bot-detection challenge.
Set a browser-like User-Agent on the underlying requests session after
creating the python-jenkins client. The value defaults to a Firefox UA
and can be overridden via the LFTOOLS_JENKINS_USER_AGENT environment
variable.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Change-Id: Id76e2348d330aff12fdfa1ecea77daf306954242
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>1 parent e733825 commit 68b14e4
1 file changed
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
44 | 50 | | |
45 | 51 | | |
46 | 52 | | |
| |||
70 | 76 | | |
71 | 77 | | |
72 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
73 | 92 | | |
0 commit comments