Skip to content

Commit

Permalink
Fixed response
Browse files Browse the repository at this point in the history
  • Loading branch information
L480 committed Mar 8, 2024
1 parent 3f5834c commit ff5beb8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions workers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ export default {
}

// JSON response with cache and CORS
const response = new Response.json(allTonies);
response.headers.set('Cache-Control', 'max-age=' + cacheTtl);
response.headers.set('Access-Control-Allow-Origin', env.CORS_ORIGINS);
const response = new Response(JSON.stringify(allTonies));
response.headers.set('Content-Type', 'application/json');
response.headers.set("Cache-Control", "max-age=" + cacheTtl);
response.headers.set("Access-Control-Allow-Origin", env.CORS_ORIGINS);
return response;
},
};

0 comments on commit ff5beb8

Please sign in to comment.