Open peedy2495 opened 4 months ago
I have to cache content from api.github.com for parsing json items in ansible deployments.
Docker-Image sonatype/nexus3:3.65.0
example task:
- name: kubernetes - install k9s - determine latest tag @GitHub uri: url: http://ubuntu-proxy:8081/repository/raw-api.github/repos/derailed/k9s/releases/latest return_content: true headers: Content-Type: "Accept: application/vnd.github+json" body_format: json register: k9s_latest
the content is stored as k9s_latest.stdout, only
using the original url it's working like a charm: https://api.github.com/repos/derailed/k9s/releases/latest
same reproduction with curl:
curl -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" http://192.168.123.180:8081/repository/raw-api.github/repos/derailed/k9s/releases/latest|less ... returns a textblock.
curl -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" http://192.168.123.180:8081/repository/raw-api.github/repos/derailed/k9s/releases/latest|less
curl -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/derailed/k9s/releases/latest|less returns clean json ...
curl -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/derailed/k9s/releases/latest|less
Using the standard header "Accept: application/json", only: all previous described methods causing the same results
Examining the content in nexus tells "Content Type : text/plain"
Nexus provides correct content types on calling types via header.
Intention
I have to cache content from api.github.com for parsing json items in ansible deployments.
Environment
Docker-Image sonatype/nexus3:3.65.0
Reproduction
example task:
the content is stored as k9s_latest.stdout, only
using the original url it's working like a charm: https://api.github.com/repos/derailed/k9s/releases/latest
same reproduction with curl:
curl -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" http://192.168.123.180:8081/repository/raw-api.github/repos/derailed/k9s/releases/latest|less
... returns a textblock.curl -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/derailed/k9s/releases/latest|less
returns clean json ...Using the standard header "Accept: application/json", only: all previous described methods causing the same results
Examining the content in nexus tells "Content Type : text/plain"
Expected behavior:
Nexus provides correct content types on calling types via header.