typegoose / mongodb-memory-server

Manage & spin up mongodb server binaries with zero(or slight) configuration for tests.
https://typegoose.github.io/mongodb-memory-server/
MIT License
2.56k stars 185 forks source link

Issue downloading mongo binaries with Nexus set as MONGOMS_DOWNLOAD_MIRROR #865

Closed SimoneDutto closed 4 months ago

SimoneDutto commented 4 months ago

Hi, I am having issue downloading mongo-binaries using a Nexus as the mirror.

After having spent some time debugging, I found the root cause of the problem to be that my nexus is not setting the content-length header. Manually removing the check at this line solved my issue.

I am willing to help solving the issue and creating a PR if needed.

hasezoey commented 4 months ago

if you want you can make a PR for that.

SimoneDutto commented 4 months ago

is it enough to remove the check or do you want something like a config variable?

hasezoey commented 4 months ago

well that check is there to ensure that the progress does not have "10MB/0MB" or something, in addition also i guess it is a slight security thing to not download unknown length for a unknown amount of time (though we dont enforce that)

i can also put out a quick fix, if you want

SimoneDutto commented 4 months ago

You are right about the security thing, but my nexus does not set this header. I don't see a way around it, besides removing the check if an env var is set. In a similar fashion to line

github-actions[bot] commented 4 months ago

:tada: This issue has been resolved in version 9.2.0-beta.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

hasezoey commented 4 months ago

a fix has been made in f3f7764dc2c61bb7897cc340f2a1544d87937461, if you enable config option DOWNLOAD_IGNORE_MISSING_HEADER, please test this works for you.

SimoneDutto commented 4 months ago

That solved the issue! Thanks a lot.

github-actions[bot] commented 4 months ago

:tada: This issue has been resolved in version 9.2.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: