Commit 0eafaeb
authored
fix(api): recognize Docker Compose/Buildx User-Agent in v2 challenge workaround (#3992)
Docker Compose and Buildx proxy through the Docker daemon, which sends
a User-Agent starting with "docker/<version>" rather than the
"Docker-Client/<version>" string sent by direct Docker CLI pulls.
This caused compose/buildx pulls to skip the 401 challenge on
registries with mixed anonymous/authenticated access policies,
resulting in 'unauthorized' errors.
Add strings.HasPrefix(ua, "docker/") alongside the existing
Docker-Client check so daemon-proxied requests from any upstream
tool (compose, buildx, etc.) are handled correctly.
Fixes #39911 parent 97b65b5 commit 0eafaeb
2 files changed
Lines changed: 44 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
419 | | - | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
420 | 425 | | |
421 | 426 | | |
422 | 427 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14261 | 14261 | | |
14262 | 14262 | | |
14263 | 14263 | | |
| 14264 | + | |
| 14265 | + | |
| 14266 | + | |
| 14267 | + | |
| 14268 | + | |
| 14269 | + | |
| 14270 | + | |
| 14271 | + | |
| 14272 | + | |
| 14273 | + | |
| 14274 | + | |
| 14275 | + | |
| 14276 | + | |
| 14277 | + | |
| 14278 | + | |
| 14279 | + | |
| 14280 | + | |
| 14281 | + | |
| 14282 | + | |
| 14283 | + | |
| 14284 | + | |
| 14285 | + | |
| 14286 | + | |
| 14287 | + | |
| 14288 | + | |
| 14289 | + | |
| 14290 | + | |
| 14291 | + | |
| 14292 | + | |
| 14293 | + | |
14264 | 14294 | | |
14265 | 14295 | | |
14266 | 14296 | | |
| |||
14309 | 14339 | | |
14310 | 14340 | | |
14311 | 14341 | | |
| 14342 | + | |
| 14343 | + | |
| 14344 | + | |
| 14345 | + | |
| 14346 | + | |
| 14347 | + | |
| 14348 | + | |
| 14349 | + | |
14312 | 14350 | | |
14313 | 14351 | | |
14314 | 14352 | | |
0 commit comments