Remitly / verdaccio-s3-storage

📦 AWS S3 storage plugin for verdaccio
MIT License
48 stars 15 forks source link

fix: if status code is 404 stream will fails by his own #19

Closed juanpicado closed 5 years ago

juanpicado commented 5 years ago

Type: bug

Description:

This is an issue I solved on Google Cloud Plugin where if we open the stream verdaccio won't try to get it from upstream As a reference https://github.com/verdaccio/verdaccio-google-cloud/blob/master/src/storage.js#L308

If the resource is not found, the stream will emit an error anyway, so, we should not open the stream if we know the resource is not there, in such case we wait the stream fails and verdaccio takes the control of the error and fetch the tarball, otherwise, we doom the user to get 404.

Here is were the error event is emitted. https://github.com/aws/aws-sdk-js/blob/fe88308a8699b39aef06492c898b265a3a24251f/lib/request.js#L38

juanpicado commented 5 years ago

Hi, If you don’t give time for this I might help.

juanpicado commented 5 years ago

@apexskier