milkio 0.0.29 → 0.0.31
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.
|
@@ -8,6 +8,7 @@ import { failCode } from "../../../src/fail-code"
|
|
|
8
8
|
import { TSON } from "@southern-aurora/tson"
|
|
9
9
|
import { createUlid } from "../utils/create-ulid"
|
|
10
10
|
import { configMilkio } from "../../../src/config/milkio"
|
|
11
|
+
import { headerToPlainObject } from "../utils/header-to-plain-object"
|
|
11
12
|
|
|
12
13
|
export type ExecuteHttpServerOptions = {
|
|
13
14
|
/**
|
|
@@ -35,7 +36,7 @@ export function defineHttpHandler(app: MilkioApp, options: ExecuteHttpServerOpti
|
|
|
35
36
|
ip,
|
|
36
37
|
method: request.request.method,
|
|
37
38
|
// @ts-ignore
|
|
38
|
-
requestHeaders: request.request.headers
|
|
39
|
+
requestHeaders: headerToPlainObject(request.request.headers),
|
|
39
40
|
timein: new Date().getTime()
|
|
40
41
|
})
|
|
41
42
|
|
|
@@ -172,7 +173,7 @@ export function defineHttpHandler(app: MilkioApp, options: ExecuteHttpServerOpti
|
|
|
172
173
|
|
|
173
174
|
await loggerSubmit(executeId)
|
|
174
175
|
runtime.execute.executeIds.delete(executeId)
|
|
175
|
-
|
|
176
|
+
|
|
176
177
|
return new Response(response.body, response)
|
|
177
178
|
}
|
|
178
179
|
|
package/index.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from "./utils/env-to-string"
|
|
|
8
8
|
export * from "./utils/env-to-number"
|
|
9
9
|
export * from "./utils/env-to-boolean"
|
|
10
10
|
export * from "./utils/create-template"
|
|
11
|
+
export * from "./utils/header-to-plain-object"
|
|
11
12
|
|
|
12
13
|
// defines
|
|
13
14
|
export * from "./defines/define-use"
|
package/kernel/milkio.ts
CHANGED
|
@@ -4,6 +4,7 @@ import schema from "../../../generated/api-schema"
|
|
|
4
4
|
import type { Context } from "../../../src/context"
|
|
5
5
|
import { failCode } from "../../../src/fail-code"
|
|
6
6
|
import type { MilkioContext } from "./context"
|
|
7
|
+
import { headerToPlainObject } from "../utils/header-to-plain-object"
|
|
7
8
|
import { type Mixin, type ExecuteId, type Fail, type FailEnumerates, loggerPushTags, loggerSubmit, runtime, TSON, type Logger, useLogger } from ".."
|
|
8
9
|
import { hanldeCatchError } from "../utils/handle-catch-error"
|
|
9
10
|
import { createUlid } from "../utils/create-ulid"
|
|
@@ -98,7 +99,7 @@ async function _execute<Path extends keyof (typeof schema)["apiMethodsTypeSchema
|
|
|
98
99
|
logger,
|
|
99
100
|
onAfterHeaders: (headers) => {
|
|
100
101
|
loggerPushTags(executeId, {
|
|
101
|
-
headers: headers
|
|
102
|
+
headers: headerToPlainObject(headers)
|
|
102
103
|
})
|
|
103
104
|
}
|
|
104
105
|
})
|
package/package.json
CHANGED
package/utils/create-template.ts
CHANGED