sonatype / nexus-public

Sonatype Nexus Repository Open-source codebase mirror
https://www.sonatype.com/products/repository-oss-download
Eclipse Public License 1.0
1.96k stars 578 forks source link

Attempting to get a raw(proxy) file with [ or ] in it results in 400 Invalid repository path #486

Open coandco opened 1 month ago

coandco commented 1 month ago

What problem are you trying to solve?

I've set up my Nexus Repository OSS installation with a raw(proxy) repository pointed at GitHub, so I can cache the freely-available fonts we're using in the build process of our application. It works for most things, but fails when there is a file with square brackets in the name.

As an example, when I try to get https://my-nexus-domain/repository/github-proxy/google/fonts/raw/main/ofl/notoserifkr/NotoSerifKR%5Bwght%5D.ttf -- a file which exists upstream as https://github.com/google/fonts/raw/main/ofl/notoserifkr/NotoSerifKR%5Bwght%5D.ttf -- Nexus returns 400 Invalid repository path and refuses to grab the file. I've verified that it happens with other square-bracketed files in other repos as well.

Do you have a workaround you are using at present?

Currently I'm just grabbing that specific file from GitHub directly, rather than caching it through the nexus raw(proxy) repository. I don't have a workaround within the product.

What feature or behavior is this required for?

Being able to proxy upstream files with special characters in their names.

How could we solve this issue? (Not knowing is okay!)

Ideally, the raw(proxy) repository type would correctly proxy upstream files with square brackets in them.

Tell us about your Nexus Repository deployment: what version, operating system, and database are you using?

I'm running the official Docker image from docker.io/sonatype/nexus3:3.72.0, on Linux, using the H2 database.

coandco commented 1 month ago

I recently upgraded to 3.72.0 from an older version before the H2 database became mandatory, and only saw the issue after I upgraded. You can see here that the file is actually present in the repository, even though I can't download it: Screenshot 2024-10-09 at 15-21-06 Browse - Nexus Repository Manager