fix qwen url (#217)
This commit is contained in:
committed by
GitHub
Unverified
parent
d63810f54b
commit
270bc1e402
@@ -223,9 +223,19 @@ class DeviceOAuthManager extends EventEmitter {
|
|||||||
|
|
||||||
let baseUrl = token.resourceUrl || defaultBaseUrl;
|
let baseUrl = token.resourceUrl || defaultBaseUrl;
|
||||||
|
|
||||||
|
// Ensure baseUrl has a protocol prefix
|
||||||
|
if (baseUrl && !baseUrl.startsWith('http://') && !baseUrl.startsWith('https://')) {
|
||||||
|
baseUrl = 'https://' + baseUrl;
|
||||||
|
}
|
||||||
|
|
||||||
// Ensure the base URL ends with /anthropic
|
// Ensure the base URL ends with /anthropic
|
||||||
if (providerType.startsWith('minimax-portal') && baseUrl) {
|
if (providerType.startsWith('minimax-portal') && baseUrl) {
|
||||||
baseUrl = baseUrl.replace(/\/v1$/, '').replace(/\/anthropic$/, '').replace(/\/$/, '') + '/anthropic';
|
baseUrl = baseUrl.replace(/\/v1$/, '').replace(/\/anthropic$/, '').replace(/\/$/, '') + '/anthropic';
|
||||||
|
} else if (providerType === 'qwen-portal' && baseUrl) {
|
||||||
|
// Ensure Qwen API gets /v1 at the end
|
||||||
|
if (!baseUrl.endsWith('/v1')) {
|
||||||
|
baseUrl = baseUrl.replace(/\/$/, '') + '/v1';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user