elysia 1.4.23 → 1.4.25

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.
@@ -27,7 +27,7 @@ __export(utils_exports, {
27
27
  tee: () => tee
28
28
  });
29
29
  module.exports = __toCommonJS(utils_exports);
30
- var import_cookies = require('../cookies.js'), import_utils = require('../utils.js'), import_utils2 = require('../universal/utils.js'), import_universal = require('../universal/index.js');
30
+ var import_cookies = require('../cookies.js'), import_utils = require('../utils.js'), import_universal = require('../universal/index.js'), import_utils2 = require('../universal/utils.js');
31
31
  const handleFile = (response, set) => {
32
32
  if (!import_utils2.isBun && response instanceof Promise)
33
33
  return response.then((res) => handleFile(res, set));
@@ -199,12 +199,7 @@ const handleSet = (set) => {
199
199
  ));
200
200
  };
201
201
  function mergeHeaders(responseHeaders, setHeaders) {
202
- const headers = new Headers(
203
- import_utils.hasHeaderShorthand ? (
204
- // @ts-ignore
205
- responseHeaders.toJSON()
206
- ) : Object.fromEntries(responseHeaders.entries())
207
- );
202
+ const headers = new Headers(responseHeaders);
208
203
  if (setHeaders instanceof Headers)
209
204
  for (const key of setHeaders.keys())
210
205
  if (key === "set-cookie") {
@@ -1,7 +1,7 @@
1
1
  import { serializeCookie } from "../cookies.mjs";
2
2
  import { hasHeaderShorthand, isNotEmpty, StatusMap } from "../utils.mjs";
3
- import { isBun } from "../universal/utils.mjs";
4
3
  import { env } from "../universal/index.mjs";
4
+ import { isBun } from "../universal/utils.mjs";
5
5
  const handleFile = (response, set) => {
6
6
  if (!isBun && response instanceof Promise)
7
7
  return response.then((res) => handleFile(res, set));
@@ -173,12 +173,7 @@ const handleSet = (set) => {
173
173
  ));
174
174
  };
175
175
  function mergeHeaders(responseHeaders, setHeaders) {
176
- const headers = new Headers(
177
- hasHeaderShorthand ? (
178
- // @ts-ignore
179
- responseHeaders.toJSON()
180
- ) : Object.fromEntries(responseHeaders.entries())
181
- );
176
+ const headers = new Headers(responseHeaders);
182
177
  if (setHeaders instanceof Headers)
183
178
  for (const key of setHeaders.keys())
184
179
  if (key === "set-cookie") {