0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-06 22:40:26 -05:00
verdaccio/test/unit/modules
薄涛 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
..
access build: format code prettier, enable ci (#2886) 2022-01-09 20:51:50 +01:00
api feat: refactor test and use verdaccio 6 core modules (#3569) 2023-01-28 14:39:37 +01:00
auth feat: refactor test and use verdaccio 6 core modules (#3569) 2023-01-28 14:39:37 +01:00
bootstrap chore: upgrade eslint and prettier (#3565) 2023-01-18 22:49:28 +01:00
cli chore: upgrade jest 29 (#3566) 2023-01-19 00:09:24 +01:00
config feat: new environment variable (storage path) (#2993) 2022-02-14 21:05:59 +01:00
notifications chore: upgrade jest 29 (#3566) 2023-01-19 00:09:24 +01:00
plugin feat: refactor test and use verdaccio 6 core modules (#3569) 2023-01-28 14:39:37 +01:00
search build: format code prettier, enable ci (#2886) 2022-01-09 20:51:50 +01:00
storage feat: replace middleware and logger core (#3586) 2023-02-09 21:42:24 +01:00
uplinks fix: avoid setting body for GET requests (#3643) 2023-02-24 07:18:18 +01:00
utils feat: refactor render middleware and audit plugin (#3602) 2023-02-14 22:20:11 +01:00
web feat: refactor render middleware and audit plugin (#3602) 2023-02-14 22:20:11 +01:00
basic_system.spec.ts chore: upgrade jest 29 (#3566) 2023-01-19 00:09:24 +01:00