Skip to content

Commit e63b0f6

Browse files
committed
perf: reduce bundle size by another 2 bytes
1 parent bed15a1 commit e63b0f6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# cors-edge
22

3-
You are writing a very simple functions that runs on edge (either on Cloudflare Workers, Fastly Edge Compute, Vercel Edge Functions, etc.) consisting of less than 100 lines of code. You want to enable CORS (Cross-Origin Resource Sharing) for your endpoint but you do not want to pull in a heavy framework with middlewares just for that. This platform-agnostic package provides a simple way to add CORS support with minimal footprint (with only `890 bytes` added to your bundle).
3+
You are writing a very simple functions that runs on edge (either on Cloudflare Workers, Fastly Edge Compute, Vercel Edge Functions, etc.) consisting of less than 100 lines of code. You want to enable CORS (Cross-Origin Resource Sharing) for your endpoint but you do not want to pull in a heavy framework with middlewares just for that. This platform-agnostic package provides a simple way to add CORS support with minimal footprint (with only `888 bytes` added to your bundle).
44

55
## Installation
66

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export const createCors = ({
9999
setHeader(response, VARY, getHeader(request, VARY) /** existing Vary */ || ORIGIN);
100100
}
101101
if (optsCredentials) {
102-
setHeader(response, ACCESS_CONTROL_PREFIX + ALLOW_PREFIX + 'Credentials', 'true');
102+
setHeader(response, ACCESS_CONTROL_PREFIX + ALLOW_PREFIX + 'Credentials', '' + optsCredentials);
103103
}
104104
if (exposeHeaders) {
105105
setHeader(response, ACCESS_CONTROL_PREFIX + 'Expose-' + HEADERS, exposeHeaders);

0 commit comments

Comments
 (0)