mirror of
https://github.com/KohakuBlueleaf/KohakuHub.git
synced 2026-04-28 09:57:43 -05:00
14 lines
364 B
JavaScript
14 lines
364 B
JavaScript
/**
|
|
* Middleware that runs before all function routes
|
|
* Useful for adding common headers like CORS
|
|
*/
|
|
export async function onRequest(context) {
|
|
// Let route handlers run first
|
|
const response = await context.next();
|
|
|
|
// Add common headers for all proxied responses
|
|
response.headers.set('Access-Control-Allow-Credentials', 'true');
|
|
|
|
return response;
|
|
}
|