[fix] throw only on web
This commit is contained in:
@@ -215,11 +215,13 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
|
|||||||
body.stream = true
|
body.stream = true
|
||||||
let urlHost = new URL(replacerURL).host
|
let urlHost = new URL(replacerURL).host
|
||||||
if(urlHost.includes("localhost") || urlHost.includes("172.0.0.1") || urlHost.includes("0.0.0.0")){
|
if(urlHost.includes("localhost") || urlHost.includes("172.0.0.1") || urlHost.includes("0.0.0.0")){
|
||||||
|
if(!isTauri){
|
||||||
return {
|
return {
|
||||||
type: 'fail',
|
type: 'fail',
|
||||||
result: 'You are trying local request on streaming. this is not allowed dude to browser/os security policy. turn off streaming.',
|
result: 'You are trying local request on streaming. this is not allowed dude to browser/os security policy. turn off streaming.',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
const da = (throughProxi)
|
const da = (throughProxi)
|
||||||
? await fetch(hubURL + `/proxy2`, {
|
? await fetch(hubURL + `/proxy2`, {
|
||||||
body: JSON.stringify(body),
|
body: JSON.stringify(body),
|
||||||
|
|||||||
Reference in New Issue
Block a user