0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00
verdaccio/test/unit
薄涛 e4573c7e15
fix: avoid setting body for GET requests (#3643)
* fix: avoid setting body for GET requests

When making a GET request to certain uplinks, such as https://registry.npmmirror.com, setting the body field can result in a 413 error. Previously, the code was setting the body field for all requests, including GET requests.

This commit fixes the issue by checking the request method and avoiding setting the body field for GET requests. This ensures that GET requests are not affected by the issue and can be made without error.

Fixes #3601

* add missing deps for run test locally

* test(up-storage): add unit test about uplink is npmmirror

Cause thers is a bug in `isObject` function from `@verdaccio/core`, when `options.json` is `true`
GET request body will be string 'true', some uplinks might return 413 status code such as
https://registry.npmmirror.com

fix #3601

* chore(deps): update @verdaccio/core

---------

Co-authored-by: Juan Picado <juanpicado19@gmail.com>
Co-authored-by: botao <botao@tal.com>
2023-02-24 07:18:18 +01:00
..
__helper feat: refactor test and use verdaccio 6 core modules (#3569) 2023-01-28 14:39:37 +01:00
modules fix: avoid setting body for GET requests (#3643) 2023-02-24 07:18:18 +01:00
partials feat: refactor test and use verdaccio 6 core modules (#3569) 2023-01-28 14:39:37 +01:00