mirror of
https://github.com/andatoshiki/toshiki-home-nuxt3.git
synced 2026-06-05 22:46:32 +00:00
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:
parent
6e60a7fff7
commit
d840674d2a
@ -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,9 @@ 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': '*'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
user: formattedUserInfo,
|
||||
recentTracks: recentTracks?.tracks?.map(mapTrack) || [],
|
||||
|
||||
Loading…
Reference in New Issue
Block a user