reorganizes origin header middleware
This commit is contained in:
parent
602931bf7f
commit
c8b3238398
|
@ -14,7 +14,7 @@ class ForbiddenError extends Error {
|
|||
* Blocks requests from Janitor AI users with a fake, scary error message so I
|
||||
* stop getting emails asking for tech support.
|
||||
*/
|
||||
export const blockZoomers: ProxyRequestMiddleware = (_proxyReq, req) => {
|
||||
export const blockZoomerOrigins: ProxyRequestMiddleware = (_proxyReq, req) => {
|
||||
if (!isCompletionRequest(req)) {
|
||||
return;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ export const blockZoomers: ProxyRequestMiddleware = (_proxyReq, req) => {
|
|||
}
|
||||
|
||||
throw new ForbiddenError(
|
||||
`This OpenAI account has been disabled due to fraud and potential CSAM violations. Your IP address, user agent, and request details have been logged and will be shared with the National Center for Missing and Exploited Children and local law enforcement's cybercrime division to assist in their investigation.`
|
||||
`Your access was terminated due to violation of our policies, please check your email for more information. If you believe this is in error and would like to appeal, please contact us through our help center at help.openai.com.`
|
||||
);
|
||||
}
|
||||
};
|
|
@ -10,12 +10,12 @@ export { transformOutboundPayload } from "./transform-outbound-payload";
|
|||
// HPM middleware (runs on onProxyReq, cannot be async)
|
||||
export { addKey } from "./add-key";
|
||||
export { addAnthropicPreamble } from "./add-anthropic-preamble";
|
||||
export { blockZoomers } from "./block-zoomers";
|
||||
export { blockZoomerOrigins } from "./block-zoomer-origins";
|
||||
export { finalizeBody } from "./finalize-body";
|
||||
export { languageFilter } from "./language-filter";
|
||||
export { limitCompletions } from "./limit-completions";
|
||||
export { limitOutputTokens } from "./limit-output-tokens";
|
||||
export { removeOrigin } from "./remove-origin";
|
||||
export { removeOriginHeaders } from "./remove-origin-headers";
|
||||
export { transformKoboldPayload } from "./transform-kobold-payload";
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,7 +4,7 @@ import { ProxyRequestMiddleware } from ".";
|
|||
* Removes origin and referer headers before sending the request to the API for
|
||||
* privacy reasons.
|
||||
**/
|
||||
export const removeOrigin: ProxyRequestMiddleware = (proxyReq) => {
|
||||
export const removeOriginHeaders: ProxyRequestMiddleware = (proxyReq) => {
|
||||
proxyReq.setHeader("origin", "");
|
||||
proxyReq.setHeader("referer", "");
|
||||
};
|
Loading…
Reference in New Issue