Skip to content

Commit

Permalink
fix(undios): add body and keepalive, fix #2
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Feb 16, 2024
1 parent 816a41e commit 6dd109e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
@@ -1,7 +1,7 @@
{
"name": "undios",
"description": "Fetch-based axios-style HTTP client",
"version": "0.1.4",
"version": "0.1.5",
"type": "module",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
8 changes: 7 additions & 1 deletion packages/core/src/index.ts
Expand Up @@ -208,7 +208,13 @@ export class HTTP extends Service {
}

try {
const init: RequestInit = { method, headers: config.headers, signal: controller.signal }
const init: RequestInit = {
method,
body: config.data,
keepalive: config.keepAlive,
headers: config.headers,
signal: controller.signal,
}
caller.emit('http/fetch-init', init, config)
const raw = await fetch(url, init).catch((cause) => {
const error = new HTTP.Error(`fetch ${url} failed`)
Expand Down
2 changes: 1 addition & 1 deletion packages/file/package.json
Expand Up @@ -56,7 +56,7 @@
},
"peerDependencies": {
"cordis": "^3.10.4",
"undios": "^0.1.4"
"undios": "^0.1.5"
},
"dependencies": {
"cosmokit": "^1.5.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/proxy-agent/package.json
Expand Up @@ -48,7 +48,7 @@
},
"peerDependencies": {
"cordis": "^3.10.4",
"undios": "^0.1.4"
"undios": "^0.1.5"
},
"dependencies": {
"http-proxy-agent": "^7.0.0",
Expand Down

0 comments on commit 6dd109e

Please sign in to comment.