GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix CORS middleware to add headers on unhandled failure responses · pingdotgg/t3code@7c95512

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/server/src
    • http.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/server/src/http.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/http.ts
+9-2Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
HttpBody,
1616
HttpClient,
1717
HttpClientResponse,
18+
HttpEffect,
1819
HttpRouter,
1920
HttpServerResponse,
2021
HttpServerRequest,
@@ -59,8 +60,14 @@ export const browserApiCorsLayer = HttpRouter.middleware(
5960
},
6061
});
6162
}
62-
const response = yield* httpEffect;
63-
return HttpServerResponse.setHeaders(response, browserApiCorsHeaders);
63+
HttpEffect.appendPreResponseHandlerUnsafe(
64+
request,
65+
(
66+
_req: HttpServerRequest.HttpServerRequest,
67+
response: HttpServerResponse.HttpServerResponse,
68+
) => Effect.succeed(HttpServerResponse.setHeaders(response, browserApiCorsHeaders)),
69+
);
70+
return yield* httpEffect;
6471
}),
6572
{ global: true },
6673
);

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.