Skip to content

Commit

Permalink
Merge pull request #145 from HannesOberreiter/dev
Browse files Browse the repository at this point in the history
fix(dev): 🐛 cors
  • Loading branch information
HannesOberreiter committed Jan 21, 2024
2 parents 21d635e + 602eac8 commit 857cc04
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/api/controllers/service.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ export default class ServiceController {
reply.raw.setHeader('Access-Control-Allow-Origin', origin);
}

if (!reply.raw.getHeader('Access-Control-Allow-Credentials')) {
reply.raw.setHeader('Access-Control-Allow-Credentials', 'true');
}

reply.raw.write(
JSON.stringify({
text: replyChunk?.choices[0]?.delta?.content || '',
Expand Down

0 comments on commit 857cc04

Please sign in to comment.