-
Notifications
You must be signed in to change notification settings - Fork 674
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into upload-fix
- Loading branch information
Showing
11 changed files
with
161 additions
and
112 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
2 changes: 1 addition & 1 deletion
2
src/browser/provider/built-in/dedicated/firefox/runtime-info.js
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 |
---|---|---|
@@ -1,29 +1,38 @@ | ||
import { GeneralError } from '../errors/runtime'; | ||
import { RUNTIME_ERRORS } from '../errors/types'; | ||
import endpointUtils from 'endpoint-utils'; | ||
import { | ||
isMyHostname, | ||
getIPAddress, | ||
isFreePort, | ||
getFreePort, | ||
} from '../utils/endpoint-utils'; | ||
|
||
export async function getValidHostname (hostname: string): Promise<string> { | ||
if (hostname) { | ||
const valid = await endpointUtils.isMyHostname(hostname); | ||
const valid = await isMyHostname(hostname); | ||
|
||
if (!valid) | ||
throw new GeneralError(RUNTIME_ERRORS.invalidHostname, hostname); | ||
} | ||
else | ||
hostname = endpointUtils.getIPAddress(); | ||
else { | ||
hostname = getIPAddress() ?? ''; | ||
|
||
if (!hostname) | ||
throw new GeneralError(RUNTIME_ERRORS.invalidHostname, hostname); | ||
} | ||
|
||
return hostname; | ||
} | ||
|
||
export async function getValidPort (port: number): Promise<number> { | ||
if (port) { | ||
const isFree = await endpointUtils.isFreePort(port); | ||
const isFree = await isFreePort(port); | ||
|
||
if (!isFree) | ||
throw new GeneralError(RUNTIME_ERRORS.portIsNotFree, port); | ||
} | ||
else | ||
port = await endpointUtils.getFreePort(); | ||
port = await getFreePort(); | ||
|
||
return port; | ||
} |
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
Oops, something went wrong.