1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-17 07:45:52 +01:00
verdaccio/test/functional/store/config-3.yaml
Will Smythe eb7a8e3528 fix(api): return 503 to npm/yarn on uplink connection timeout (#1331)
fix  #1328 and #720

Type: bug

The following has been addressed in the PR:

Instead of returning a 404 (Not Found) when npm, yarn, etc requests a package and the package cannot be acquired from an uplink due to a connection timeout, socket timeout, or connection reset problem, a 503 (service unavailable) is returned by Verdaccio instead. In limited testing of a few versions of npm and yarn, both of these clients correctly attempt to retry the request when a 503 is returned.

Added functional tests to verify the behavior (this adds a dev dependency on nock, which provides HTTP request mocking

Description:

This resolves issue #1328 and #720, and ensures npm/yarn install commands don't fail immediately when there is an intermittent network timeout problem with an uplink. Instead Verdaccio will appropriately respond to the client with a 503. A 404 response (current behavior) incorrectly tells the client that the package does not exist (which may or may not be true) and to not try again.
2019-06-13 21:42:01 +02:00

47 lines
676 B
YAML

storage: ./test-storage3
web:
enable: true
title: verdaccio-server-3
uplinks:
server1:
url: http://localhost:55551/
server2:
url: http://localhost:55552/
cache: false
auth:
auth-memory:
users:
test:
name: test
password: test
logs:
- { type: stdout, format: pretty, level: trace }
packages:
'pkg-gh131':
access: $all
proxy: server1
'testpkg-preserve':
access: test $anonymous
publish: test $anonymous
proxy: server1
'pkg-gh1312':
access: $all
proxy: server2
'test-uplink-timeout-*':
access: $all
publish: $all
'*':
access: $all
# expose internal methods
_debug: true