-
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli,js-runtime): allow any protocols for URL parsing (#834)
- Loading branch information
Showing
6 changed files
with
37 additions
and
19 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@lagon/runtime': patch | ||
--- | ||
|
||
Improve Request/Response error messages |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@lagon/cli': patch | ||
'@lagon/js-runtime': patch | ||
--- | ||
|
||
Allow any protocols for URL parsing |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -359,4 +359,26 @@ describe('URL', () => { | |
expect(url.href).toEqual('https://foo:[email protected]/en-US/docs/Web/API/URL/password'); | ||
}); | ||
}); | ||
|
||
describe('any protocol', () => { | ||
it('should work with mysql protocol', () => { | ||
const url = new URL('mysql://user:[email protected]/db?sslaccept=strict'); | ||
expect(url.protocol).toEqual('mysql:'); | ||
expect(url.username).toEqual('user'); | ||
expect(url.password).toEqual('pass'); | ||
expect(url.host).toEqual('my.host'); | ||
expect(url.pathname).toEqual('/db'); | ||
expect(url.search).toEqual('?sslaccept=strict'); | ||
}); | ||
|
||
it('should work with postgres protocol', () => { | ||
const url = new URL('postgres://user:[email protected]/db'); | ||
expect(url.protocol).toEqual('postgres:'); | ||
expect(url.username).toEqual('user'); | ||
expect(url.password).toEqual('pass'); | ||
expect(url.host).toEqual('my.host'); | ||
expect(url.pathname).toEqual('/db'); | ||
expect(url.search).toEqual(''); | ||
}); | ||
}); | ||
}); |
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