pl-api: Do not set content type when body is not set
Signed-off-by: mkljczk <git@mkljczk.pl>
This commit is contained in:
@ -55,7 +55,7 @@ function request<T = any>(this: Pick<PlApiClient, 'accessToken' | 'baseURL'>, in
|
||||
const headers = new Headers();
|
||||
|
||||
if (this.accessToken) headers.set('Authorization', `Bearer ${this.accessToken}`);
|
||||
if (contentType !== '') headers.set('Content-Type', contentType);
|
||||
if (contentType !== '' && body) headers.set('Content-Type', contentType);
|
||||
if (idempotencyKey) headers.set('Idempotency-Key', contentType);
|
||||
|
||||
body = body && contentType === '' ? serialize(body, { indices: true }) : JSON.stringify(body);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "pl-api",
|
||||
"version": "1.0.0-rc.30",
|
||||
"version": "1.0.0-rc.31",
|
||||
"type": "module",
|
||||
"homepage": "https://github.com/mkljczk/pl-fe/tree/develop/packages/pl-api",
|
||||
"repository": {
|
||||
|
||||
@ -103,7 +103,7 @@
|
||||
"multiselect-react-dropdown": "^2.0.25",
|
||||
"mutative": "^1.1.0",
|
||||
"path-browserify": "^1.0.1",
|
||||
"pl-api": "^1.0.0-rc.30",
|
||||
"pl-api": "^1.0.0-rc.31",
|
||||
"postcss": "^8.4.49",
|
||||
"process": "^0.11.10",
|
||||
"punycode": "^2.1.1",
|
||||
|
||||
@ -7553,10 +7553,10 @@ pkg-dir@^4.1.0:
|
||||
dependencies:
|
||||
find-up "^4.0.0"
|
||||
|
||||
pl-api@^1.0.0-rc.30:
|
||||
version "1.0.0-rc.30"
|
||||
resolved "https://registry.yarnpkg.com/pl-api/-/pl-api-1.0.0-rc.30.tgz#1702557d5e723ba40c73323782c4ad3910e3f908"
|
||||
integrity sha512-9rmx87EV3oqI3e2ZonHVRcYBS3J1SyfQBNMmWwPmr0aPiA/kVeDcCgRjlxc0Z0srLWGg4Bwfxdcp8zx7aSRMqg==
|
||||
pl-api@^1.0.0-rc.31:
|
||||
version "1.0.0-rc.31"
|
||||
resolved "https://registry.yarnpkg.com/pl-api/-/pl-api-1.0.0-rc.31.tgz#2098a206d02b46a8eb7a6cee95ce2310b04d6ca4"
|
||||
integrity sha512-diLs1nlN/OZ4ENeuNieKN9YYn7o5gzjFZutkXWFI8JyDEIX8niljeeFtPAgaYf9XFajCnOfVNY+Kx4QXNru2Yg==
|
||||
dependencies:
|
||||
blurhash "^2.0.5"
|
||||
http-link-header "^1.1.3"
|
||||
|
||||
Reference in New Issue
Block a user