mirror of
https://github.com/andatoshiki/toshiki-home-nuxt3.git
synced 2026-06-06 00:46:29 +00:00
fix(cors): remove header cors policy for fetching function generated contents from remote origins avoiding automatic blockages
This commit is contained in:
parent
47da4cd45d
commit
6e60a7fff7
@ -22,7 +22,7 @@ const handler: Handler = async () => {
|
||||
]
|
||||
|
||||
// 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
|
||||
const mapTrack = (track: any): any => {
|
||||
@ -68,11 +68,11 @@ const handler: Handler = async () => {
|
||||
return {
|
||||
statusCode: 200,
|
||||
error: false,
|
||||
headers: {
|
||||
'Access-Control-Allow-Origin': origin,
|
||||
'Access-Control-Allow-Headers': 'Content-Type',
|
||||
'Access-Control-Allow-Methods': 'GET'
|
||||
},
|
||||
// headers: {
|
||||
// 'Access-Control-Allow-Origin': origin,
|
||||
// 'Access-Control-Allow-Headers': 'Content-Type',
|
||||
// 'Access-Control-Allow-Methods': 'GET'
|
||||
// },
|
||||
body: JSON.stringify({
|
||||
user: formattedUserInfo,
|
||||
recentTracks: recentTracks?.tracks?.map(mapTrack) || [],
|
||||
|
||||
Loading…
Reference in New Issue
Block a user