Skip to content

Commit

Permalink
set response Content-Type to text/event-stream
Browse files Browse the repository at this point in the history
  • Loading branch information
ShinChven committed Aug 12, 2023
1 parent 1047f68 commit f642d34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions express-openai-azure-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ app.all('/v1/models', async (req, res) => {
}

const json = JSON.stringify(data, null, 2);
res.setHeader('Content-Type', 'text/event-stream');
res.setHeader('Content-Type', 'application/json');
res.send(json);
});

Expand Down Expand Up @@ -168,7 +168,7 @@ function getPayload(req, res, url) {
async function handleResponse(req, res, axiosResponse) {
// Set headers and status
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Content-Type', 'application/json');
res.setHeader('Content-Type', 'text/event-stream');
res.status(axiosResponse.status);

// Pipe the response stream directly into the response
Expand Down

0 comments on commit f642d34

Please sign in to comment.