koa-files 3.2.0 → 3.2.1
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/cjs/ReadStream.cjs +1 -1
- package/cjs/Service.cjs +1 -1
- package/cjs/index.cjs +1 -1
- package/cjs/utils/fs.cjs +1 -1
- package/cjs/utils/hash.cjs +1 -1
- package/cjs/utils/http.cjs +3 -2
- package/cjs/utils/path.cjs +1 -1
- package/esm/ReadStream.js +1 -1
- package/esm/Service.js +1 -1
- package/esm/index.js +1 -1
- package/esm/utils/fs.js +1 -1
- package/esm/utils/hash.js +1 -1
- package/esm/utils/http.js +3 -2
- package/esm/utils/path.js +1 -1
- package/package.json +1 -1
package/cjs/ReadStream.cjs
CHANGED
package/cjs/Service.cjs
CHANGED
package/cjs/index.cjs
CHANGED
package/cjs/utils/fs.cjs
CHANGED
package/cjs/utils/hash.cjs
CHANGED
package/cjs/utils/http.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package koa-files
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 3.2.
|
|
4
|
+
* @version 3.2.1
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A static files serving middleware for koa.
|
|
7
7
|
* @see https://github.com/nuintun/koa-files#readme
|
|
@@ -157,7 +157,8 @@ function parseRanges(context, stats) {
|
|
|
157
157
|
// Range suffix.
|
|
158
158
|
const suffix = buffer.Buffer.from(`\r\n--${boundary}--\r\n`);
|
|
159
159
|
// Override Content-Type.
|
|
160
|
-
|
|
160
|
+
// https://httpwg.org/specs/rfc9110.html#multipart.byteranges
|
|
161
|
+
response.type = `multipart/byteranges; boundary=${boundary}`;
|
|
161
162
|
// Map ranges.
|
|
162
163
|
for (const [index, { start, end }] of entries) {
|
|
163
164
|
const length = end - start + 1;
|
package/cjs/utils/path.cjs
CHANGED
package/esm/ReadStream.js
CHANGED
package/esm/Service.js
CHANGED
package/esm/index.js
CHANGED
package/esm/utils/fs.js
CHANGED
package/esm/utils/hash.js
CHANGED
package/esm/utils/http.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package koa-files
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 3.2.
|
|
4
|
+
* @version 3.2.1
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A static files serving middleware for koa.
|
|
7
7
|
* @see https://github.com/nuintun/koa-files#readme
|
|
@@ -149,7 +149,8 @@ function parseRanges(context, stats) {
|
|
|
149
149
|
// Range suffix.
|
|
150
150
|
const suffix = Buffer.from(`\r\n--${boundary}--\r\n`);
|
|
151
151
|
// Override Content-Type.
|
|
152
|
-
|
|
152
|
+
// https://httpwg.org/specs/rfc9110.html#multipart.byteranges
|
|
153
|
+
response.type = `multipart/byteranges; boundary=${boundary}`;
|
|
153
154
|
// Map ranges.
|
|
154
155
|
for (const [index, { start, end }] of entries) {
|
|
155
156
|
const length = end - start + 1;
|
package/esm/utils/path.js
CHANGED