@fluojs/platform-fastify 1.0.2 → 1.0.3
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.
- package/README.ko.md +2 -2
- package/README.md +2 -2
- package/dist/adapter.js +1 -1
- package/package.json +5 -5
package/README.ko.md
CHANGED
|
@@ -48,7 +48,7 @@ await app.listen();
|
|
|
48
48
|
### 멀티파트 및 Raw Body
|
|
49
49
|
Fastify 어댑터는 내부 Fastify 플러그인을 통해 멀티파트 form-data 및 raw body 파싱을 기본적으로 지원하며, 이는 표준 fluo 요청 인터페이스를 통해 노출됩니다. `rawBody: true`를 활성화하면 멀티파트가 아닌 요청에서 `FrameworkRequest.rawBody`가 원본 요청 바이트를 그대로 보존하므로 webhook 서명 검증이나 기타 바이트 민감한 흐름에서 정확한 payload를 다시 사용할 수 있습니다. 어댑터를 직접 생성할 때는 멀티파트 제한을 두 번째 인자로 전달하고, `bootstrapFastifyApplication(...)` 및 `runFastifyApplication(...)`에서는 같은 설정을 `options.multipart` 아래에 전달하면 됩니다.
|
|
50
50
|
|
|
51
|
-
Multipart request에서는 raw-body capture를 건너뜁니다. `multipart.maxTotalSize`를 생략하면 `maxBodySize`가 기본값이 되어 HTTP adapter 간 size limit이 portable하게 유지됩니다.
|
|
51
|
+
Multipart request에서는 `Multipart/Form-Data`처럼 대소문자가 섞인 `Content-Type` media 값도 포함해 raw-body capture를 건너뜁니다. `multipart.maxTotalSize`를 생략하면 `maxBodySize`가 기본값이 되어 HTTP adapter 간 size limit이 portable하게 유지됩니다.
|
|
52
52
|
|
|
53
53
|
```typescript
|
|
54
54
|
const adapter = createFastifyAdapter(
|
|
@@ -152,7 +152,7 @@ fluo의 Fastify 어댑터는 높은 동시성 시나리오에서 raw Node.js 어
|
|
|
152
152
|
|
|
153
153
|
`packages/platform-fastify/src/adapter.test.ts`는 문서화된 Fastify 어댑터 계약을 위한 package-local regression target입니다. 이 파일은 공유 `createHttpAdapterPortabilityHarness(...)` 검사를 실행하여 malformed cookie 보존, JSON/text raw-body capture, byte-exact raw-body capture, multipart raw-body 제외, multipart total-size 기본값, SSE framing, response stream drain settlement, host 및 HTTPS startup logging, shutdown signal listener cleanup을 확인합니다.
|
|
154
154
|
|
|
155
|
-
같은 파일은 Fastify 전용 native route registration과 wildcard fallback, duplicate shape route fallback, middleware/guard/interceptor/observer ordering, CORS ownership, global prefix behavior, malformed cookie preservation, response serialization parity, raw-body pre-parsing behavior, multipart limit handling도 함께 다룹니다. startup, routing, adapter portability behavior를 변경할 때는 README 예제 포인터를 이 테스트 파일 및 custom adapter book chapter와 맞추어 유지하세요.
|
|
155
|
+
같은 파일은 Fastify 전용 native route registration과 wildcard fallback, duplicate shape route fallback, middleware/guard/interceptor/observer ordering, CORS ownership, global prefix behavior, malformed cookie preservation, response serialization parity, raw-body pre-parsing behavior, 대소문자 구분 없는 multipart detection, multipart limit handling도 함께 다룹니다. startup, routing, adapter portability behavior를 변경할 때는 README 예제 포인터를 이 테스트 파일 및 custom adapter book chapter와 맞추어 유지하세요.
|
|
156
156
|
|
|
157
157
|
## 공개 API 개요
|
|
158
158
|
|
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ await app.listen();
|
|
|
48
48
|
### Multipart and Raw Body
|
|
49
49
|
The Fastify adapter includes built-in support for multipart form-data and raw body parsing via internal Fastify plugins, exposed through the standard fluo request interface. When `rawBody: true` is enabled, `FrameworkRequest.rawBody` preserves the original request bytes for non-multipart requests so webhook signature verification and other byte-sensitive flows can replay the exact payload. When you construct the adapter directly, pass multipart limits as the second argument. `bootstrapFastifyApplication(...)` and `runFastifyApplication(...)` accept the same multipart settings under `options.multipart`.
|
|
50
50
|
|
|
51
|
-
Raw-body capture is skipped for multipart requests
|
|
51
|
+
Raw-body capture is skipped for multipart requests, including mixed-case `Content-Type` media values such as `Multipart/Form-Data`. When `multipart.maxTotalSize` is omitted, it defaults to `maxBodySize` so size limits stay portable across HTTP adapters.
|
|
52
52
|
|
|
53
53
|
```typescript
|
|
54
54
|
const adapter = createFastifyAdapter(
|
|
@@ -152,7 +152,7 @@ fluo's Fastify adapter significantly outperforms the raw Node.js adapter in high
|
|
|
152
152
|
|
|
153
153
|
`packages/platform-fastify/src/adapter.test.ts` is the package-local regression target for the documented Fastify adapter contract. It runs the shared `createHttpAdapterPortabilityHarness(...)` checks for malformed cookie preservation, JSON/text raw-body capture, byte-exact raw-body capture, multipart raw-body exclusion, multipart total-size defaults, SSE framing, response stream drain settlement, host and HTTPS startup logging, and shutdown signal listener cleanup.
|
|
154
154
|
|
|
155
|
-
The same file also covers Fastify-specific native route registration with wildcard fallback, duplicate shape route fallback, middleware/guard/interceptor/observer ordering, CORS ownership, global prefix behavior, malformed cookie preservation, response serialization parity, raw-body pre-parsing behavior, and multipart limit handling. Keep README example pointers aligned with that test file and the custom adapter book chapter when changing startup, routing, or adapter portability behavior.
|
|
155
|
+
The same file also covers Fastify-specific native route registration with wildcard fallback, duplicate shape route fallback, middleware/guard/interceptor/observer ordering, CORS ownership, global prefix behavior, malformed cookie preservation, response serialization parity, raw-body pre-parsing behavior, case-insensitive multipart detection, and multipart limit handling. Keep README example pointers aligned with that test file and the custom adapter book chapter when changing startup, routing, or adapter portability behavior.
|
|
156
156
|
|
|
157
157
|
## Public API Overview
|
|
158
158
|
|
package/dist/adapter.js
CHANGED
|
@@ -797,7 +797,7 @@ function captureRawBodyPreParsingHook(request, _reply, payload, done) {
|
|
|
797
797
|
}
|
|
798
798
|
function isMultipartRequestContentType(contentType) {
|
|
799
799
|
const primaryValue = Array.isArray(contentType) ? contentType[0] : contentType;
|
|
800
|
-
return typeof primaryValue === 'string' && primaryValue.includes('multipart/form-data');
|
|
800
|
+
return typeof primaryValue === 'string' && primaryValue.toLowerCase().includes('multipart/form-data');
|
|
801
801
|
}
|
|
802
802
|
function resolveListenTarget(address, port, host, useHttps) {
|
|
803
803
|
const protocol = useHttps ? 'https' : 'http';
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"platform",
|
|
9
9
|
"server"
|
|
10
10
|
],
|
|
11
|
-
"version": "1.0.
|
|
11
|
+
"version": "1.0.3",
|
|
12
12
|
"private": false,
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"repository": {
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"@fastify/multipart": "^9.2.1",
|
|
39
39
|
"fastify": "^5.8.5",
|
|
40
40
|
"fastify-raw-body": "^5.0.0",
|
|
41
|
-
"@fluojs/http": "^1.
|
|
42
|
-
"@fluojs/runtime": "^1.1.
|
|
41
|
+
"@fluojs/http": "^1.1.0",
|
|
42
|
+
"@fluojs/runtime": "^1.1.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"vitest": "^3.2.4",
|
|
46
|
-
"@fluojs/
|
|
47
|
-
"@fluojs/
|
|
46
|
+
"@fluojs/di": "^1.0.3",
|
|
47
|
+
"@fluojs/testing": "^1.0.3"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"prebuild": "node ../../tooling/scripts/clean-dist.mjs",
|