fixes org-ID redaction on errors which don't include one
This commit is contained in:
parent
e0529197cd
commit
119c2f827a
|
@ -292,9 +292,9 @@ const handleDownstreamErrors: ProxyResHandlerWithBody = async (
|
|||
} else {
|
||||
errorPayload.proxy_note = `Unrecognized error from OpenAI.`;
|
||||
}
|
||||
|
||||
// Don't leak the org id outside the proxy
|
||||
errorPayload.message.replace(/org-.{24}/gm, "org-xxxxxxxxxxxxxxxxxxx");
|
||||
|
||||
// Some OAI errors contain the organization ID, which we don't want to reveal.
|
||||
errorPayload.message?.replace(/org-.{24}/gm, "org-xxxxxxxxxxxxxxxxxxx");
|
||||
|
||||
res.status(statusCode).json(errorPayload);
|
||||
throw new Error(errorPayload.error?.message);
|
||||
|
|
Loading…
Reference in New Issue