Content-Disposition Header Not In Curl Response

I’m unable to download the latest version of an artifact using the REST API due to the content-disposition header seemingly not being set in the response header. Using the below command - with certain parts altered for this ticket:

curl -X GET -LJO “https://{nexus}/service/rest/v1/search/assets/download?sort=version&repository={repository}&name={artifact name}”

When I do a verbose curl, I can see that the content-disposition header is never defined hence the file is named ‘download?sort=version…’

Am I missing something?

The response from that URL is a redirect to the repository URL for the particular file you’re downloading.

Yes I get that, that’s why I have the -L to follow the redirect, however I’ve seen other people suggesting the exact above solution to have the file saved per the artifact name, but when I use it, there is no content-disposition header and so the name of the artifact is not used.

I can’t speak to the above error. But I don’t think that conclusion is correct. For example, if you run:
You get an error stating that “you are being redirected”. Changing that to:
curl -JLO
It successfully follows the redirect and saves the file using the name in Content-Disposition header. So it is possible. I think that Nexus just does not set the Content-Disposition header which is another issue in itself and nothing to do with curl.