Fix OpenRouter caption headers

This commit is contained in:
Cohee 2024-06-22 01:42:28 +03:00
parent a00560d2b3
commit 9c2de78ad3
1 changed files with 2 additions and 1 deletions

View File

@ -6,6 +6,7 @@ const fs = require('fs');
const { jsonParser, urlencodedParser } = require('../express-common');
const { getConfigValue, mergeObjectWithYaml, excludeKeysByYaml, trimV1 } = require('../util');
const { setAdditionalHeaders } = require('../additional-headers');
const { OPENROUTER_HEADERS } = require('../constants');
const router = express.Router();
@ -80,7 +81,7 @@ router.post('/caption-image', jsonParser, async (request, response) => {
if (request.body.api === 'openrouter') {
apiUrl = 'https://openrouter.ai/api/v1/chat/completions';
headers['HTTP-Referer'] = request.headers.referer;
Object.assign(headers, OPENROUTER_HEADERS);
}
if (request.body.api === 'openai') {