fix(cors): update allowed access origin to wildcard yet again avoiding content fetching failure when utilizing get method for http access

This commit is contained in:
Anda Toshiki 2024-05-09 01:36:33 -07:00
parent 6e60a7fff7
commit d840674d2a

View File

@ -22,7 +22,7 @@ const handler: Handler = async () => {
] ]
// Origin for CORS // Origin for CORS
// const origin = process.env.NODE_ENV === 'production' ? 'https://toshiki.dev' : 'http://localhost:3000' const origin = process.env.NODE_ENV === 'production' ? 'https://toshiki.dev' : 'http://localhost:3000'
// Map track function // Map track function
const mapTrack = (track: any): any => { const mapTrack = (track: any): any => {
@ -68,11 +68,9 @@ const handler: Handler = async () => {
return { return {
statusCode: 200, statusCode: 200,
error: false, error: false,
// headers: { headers: {
// 'Access-Control-Allow-Origin': origin, 'access-control-allow-origin': '*'
// 'Access-Control-Allow-Headers': 'Content-Type', },
// 'Access-Control-Allow-Methods': 'GET'
// },
body: JSON.stringify({ body: JSON.stringify({
user: formattedUserInfo, user: formattedUserInfo,
recentTracks: recentTracks?.tracks?.map(mapTrack) || [], recentTracks: recentTracks?.tracks?.map(mapTrack) || [],