Skip to content

Commit

Permalink
Enable CORS
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanoverna committed Dec 24, 2024
1 parent 78b8f06 commit 9b909f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pages/hardcoded-routes.json.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { APIRoute } from 'astro';
import { handleUnexpectedError, json } from './api/_utils';
import { handleUnexpectedError, json, withCORS } from './api/_utils';
import { buildSitemapUrls as cmaResourceEndpointUrls } from './docs/content-management-api/resources/[entitySlug]/[endpointRel]/_graphql';
import { buildSitemapUrls as cmaResourceUrls } from './docs/content-management-api/resources/[entitySlug]/_graphql';

Expand Down Expand Up @@ -41,7 +41,7 @@ export const GET: APIRoute = async ({ request }) => {
cmaResourceEndpointUrls({ request, responseHeaders }),
]);

return json(urls.flat(), { headers: responseHeaders });
return json(urls.flat(), withCORS({ headers: responseHeaders }));
} catch (error) {
return handleUnexpectedError(request, error);
}
Expand Down

0 comments on commit 9b909f2

Please sign in to comment.