@duque.edits/sdk 1.6.8 → 1.6.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/rest/REST.js +12 -5
  2. package/package.json +1 -1
package/dist/rest/REST.js CHANGED
@@ -115,12 +115,19 @@ class REST extends import_events.default {
115
115
  if ("cache" in body) delete body.cache;
116
116
  if ("rest" in body) delete body.rest;
117
117
  if ("guilds" in body) delete body.guilds;
118
+ const methodUpper = method.toUpperCase();
119
+ const hasBody = body !== void 0 && body !== null && methodUpper !== "GET" && methodUpper !== "HEAD";
118
120
  const res = await (0, import_undici.request)(url, {
119
- method: method.toUpperCase(),
120
- headers,
121
- body: JSON.stringify(body),
122
- bodyTimeout: 120 * 1e3,
123
- headersTimeout: 120 * 1e3
121
+ method: methodUpper,
122
+ headers: {
123
+ ...headers,
124
+ ...hasBody && { "content-type": "application/json" }
125
+ },
126
+ ...hasBody && {
127
+ body: JSON.stringify(body)
128
+ },
129
+ bodyTimeout: 12e4,
130
+ headersTimeout: 12e4
124
131
  });
125
132
  const responseBody = await res.body.json();
126
133
  const { data, message } = responseBody;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duque.edits/sdk",
3
- "version": "1.6.8",
3
+ "version": "1.6.9",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",