-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(sdk): failed to transform proxy port between sdk and renderer (#8175
) * fix: update the proxy transforming between sdk and inso * fix: lint error * fix: smoke test * chore: enable sentry for the hidden window * chore: add tag for sentry reporting
- Loading branch information
Showing
7 changed files
with
121 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { describe, expect, it } from 'vitest'; | ||
|
||
import { ProxyConfig, ProxyConfigList } from '../proxy-configs'; | ||
import { ProxyConfig, ProxyConfigList, transformToSdkProxyOptions } from '../proxy-configs'; | ||
import { Url } from '../urls'; | ||
|
||
describe('test ProxyConfig object', () => { | ||
|
@@ -15,6 +15,7 @@ describe('test ProxyConfig object', () => { | |
authenticate: true, | ||
username: 'proxy_username', | ||
password: 'proxy_password', | ||
protocol: 'https:', | ||
}); | ||
|
||
expect( | ||
|
@@ -23,15 +24,8 @@ describe('test ProxyConfig object', () => { | |
['http', 'https'] | ||
); | ||
|
||
proxyConfig.updateProtocols(['http']); | ||
expect( | ||
proxyConfig.getProtocols() | ||
).toEqual( | ||
['http'] | ||
); | ||
|
||
expect(proxyConfig.getProxyUrl()).toEqual( | ||
'proxy_username:[email protected]:8080' | ||
'https://proxy_username:[email protected]:8080' | ||
); | ||
|
||
expect( | ||
|
@@ -49,9 +43,26 @@ describe('test ProxyConfig object', () => { | |
authenticate: true, | ||
username: 'proxy_username', | ||
password: 'proxy_password', | ||
protocol: 'https:', | ||
})); | ||
|
||
const matchedProxyConfigDef = configList.resolve(new Url('http://sub.example.com:80/path')); | ||
expect(matchedProxyConfigDef?.host).toEqual('proxy.com'); | ||
}); | ||
|
||
const proxyUrls = [ | ||
'http://wormhole', | ||
'http://wormhole:0', | ||
'https://localhost', | ||
'http://user:pass@localhost:666', | ||
'http://user:pass@localhost:0', | ||
'http://user:pass@localhost', | ||
]; | ||
|
||
proxyUrls.forEach(url => { | ||
it(`test proxy transforming: ${url}`, () => { | ||
const proxy = new ProxyConfig(transformToSdkProxyOptions(url, '', true, '')); | ||
expect(proxy.getProxyUrl()).toEqual(url); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters