Skip to content

Commit 2a705b5

Browse files
committed
2 parents 6c36715 + afa559d commit 2a705b5

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/components/Manga/actions/translation/selfhosted.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,11 @@ export const selfhostedTranslation = async (url: string): Promise<string> => {
8787
);
8888
}
8989

90+
const headers_ngrok = apiUrl().includes('ngrok-free')? new Headers({ "ngrok-skip-browser-warning": "69420" }) : undefined;
9091
try {
9192
const res = await fetch(`${apiUrl()}/translate/with-form/image/stream`, {
9293
method: 'POST',
94+
headers: headers_ngrok,
9395
body: createFormData(imgBlob, 'selfhosted'),
9496
});
9597

@@ -147,6 +149,7 @@ export const selfhostedTranslation = async (url: string): Promise<string> => {
147149
responseType: 'blob',
148150
fetch: false,
149151
timeout: 1000 * 60 * 10,
152+
headers: headers_ngrok,
150153
data: createFormData(imgBlob, 'selfhosted'),
151154
errorText: t('translation.tip.upload_error'),
152155
});

0 commit comments

Comments
 (0)