mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-08-02 00:00:35 +00:00
chatgpt: ensure no extra newline in header
This commit is contained in:
parent
f0faa23ad5
commit
ad0e7fd01f
@ -155,7 +155,7 @@ void ChatGPTWorker::request(const QString &apiKey,
|
||||
m_ctx = promptCtx;
|
||||
|
||||
QUrl openaiUrl("https://api.openai.com/v1/chat/completions");
|
||||
const QString authorization = QString("Bearer %1").arg(apiKey);
|
||||
const QString authorization = QString("Bearer %1").arg(apiKey).trimmed();
|
||||
QNetworkRequest request(openaiUrl);
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||
request.setRawHeader("Authorization", authorization.toUtf8());
|
||||
|
Loading…
Reference in New Issue
Block a user