jsr icon indicating copy to clipboard operation
jsr copied to clipboard

Nexus raw proxy support

Open peterreisz opened this issue 1 year ago • 0 comments

Hi!

In corp environments there is a central package registry/proxy and everything has to communicate to it. This proxy can be the only one to communicate to the outside world.

I'm trying to setup a raw proxy type repo in Nexus, but it serving me the html content instead of the typescript files.

Nexus can be run easily with docker: https://hub.docker.com/r/sonatype/nexus3/, but here is a curl command, how it tries to fetch the files from Jsr:

curl --header "user-agent: Nexus/3.71.0-06 (OSS; Linux; 6.10.5-1-default; amd64; 17.0.12) Deno/1.46.1" \
--header "accept-encoding: gzip,deflate" \
--header "connection: Keep-Alive" \
--header "accept: " \
https://jsr.io/@std/assert/1.0.2/assert.ts --output file.gz

The problem is with the accept header. By default the curl send a */*, but the nexus does not send any accept header. The best I can do is append a string at the end of the user-agent header, see above: Deno/1.46.1

Is is possible to fix it in Jsr or is it a Nexus problem?

peterreisz avatar Aug 26 '24 07:08 peterreisz