two-stroke 1.0.32 → 1.0.33
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/package.json +1 -1
- package/src/index.ts +7 -6
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -147,14 +147,15 @@ export function twoStroke<T extends Env>(title: string, release: string) {
|
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
-
|
|
151
|
-
if (!headers.has("Content-Type"))
|
|
152
|
-
headers.set("Content-Type", "application/json");
|
|
153
|
-
if (!headers.has("Access-Control-Allow-Origin"))
|
|
154
|
-
headers.set("Access-Control-Allow-Origin", "*");
|
|
150
|
+
response.headers = new Headers(response.headers ?? {});
|
|
151
|
+
if (!response.headers.has("Content-Type"))
|
|
152
|
+
response.headers.set("Content-Type", "application/json");
|
|
153
|
+
if (!response.headers.has("Access-Control-Allow-Origin"))
|
|
154
|
+
response.headers.set("Access-Control-Allow-Origin", "*");
|
|
155
|
+
|
|
155
156
|
return new Response(
|
|
156
157
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
157
|
-
headers.get("Content-Type") === "application/json"
|
|
158
|
+
response.headers.get("Content-Type") === "application/json"
|
|
158
159
|
? JSON.stringify(response.body)
|
|
159
160
|
: response.body,
|
|
160
161
|
response,
|