Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure 404s from registry.npmjs.org gets 404 response from open-registry #29

Open
victorb opened this issue May 1, 2019 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@victorb
Copy link
Member

victorb commented May 1, 2019

Currently, doing the following renders a 404:

$ wget https://registry.npmjs.org/emitter/-/emitter-1.2.1.tgz
--2019-05-01 18:03:12--  https://registry.npmjs.org/emitter/-/emitter-1.2.1.tgz
Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt'
Resolving registry.npmjs.org (registry.npmjs.org)... 104.16.23.35, 104.16.19.35, 104.16.25.35, ...
Connecting to registry.npmjs.org (registry.npmjs.org)|104.16.23.35|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2019-05-01 18:03:13 ERROR 404: Not Found.

But if we try to get the same tarball from open-registry, it fails with a 500 instead of 404.

$ wget https://npm.open-registry.dev/emitter/-/emitter-1.2.1.tgz
--2019-05-01 18:03:32--  https://npm.open-registry.dev/emitter/-/emitter-1.2.1.tgz
Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt'
Resolving npm.open-registry.dev (npm.open-registry.dev)... 136.243.78.134, 2a01:4f8:212:2c9d::2
Connecting to npm.open-registry.dev (npm.open-registry.dev)|136.243.78.134|:443... connected.
HTTP request sent, awaiting response... 500 Internal Server Error
2019-05-01 18:03:32 ERROR 500: Internal Server Error.

In this specific case we need to make sure the handler for tarballs, when making a request to npm, also returns the 404 if it happens. This would be done here: https://github.com/open-services/open-registry/blob/master/src/open_registry/http.clj#L55

Also need to make sure it's working the same for getting the metadata.

@victorb victorb added bug Something isn't working good first issue Good for newcomers labels May 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant