mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
fix osUpdate check and address parser for Tor without protocol (#2941)
This commit is contained in:
@@ -56,7 +56,9 @@ export function getAddresses(
|
||||
addresses.forEach(url => {
|
||||
if (h.kind === 'onion') {
|
||||
tor.push({
|
||||
protocol: new URL(url).protocol.replace(':', '').toUpperCase(),
|
||||
protocol: /^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(url)
|
||||
? new URL(url).protocol.replace(':', '').toUpperCase()
|
||||
: null,
|
||||
url,
|
||||
})
|
||||
} else {
|
||||
@@ -128,5 +130,5 @@ export type LocalAddress = {
|
||||
|
||||
export type TorAddress = {
|
||||
url: string
|
||||
protocol: string
|
||||
protocol: string | null
|
||||
}
|
||||
|
||||
@@ -54,10 +54,12 @@ export class OSService {
|
||||
serverId: id,
|
||||
})
|
||||
|
||||
const [latest, _] = Object.entries(this.osUpdate).at(-1)!
|
||||
const latest = Object.entries(this.osUpdate).at(-1)?.[0]
|
||||
|
||||
this.updateAvailable$.next(
|
||||
Version.parse(latest).compare(Version.parse(version)) === 'greater',
|
||||
latest
|
||||
? Version.parse(latest).compare(Version.parse(version)) === 'greater'
|
||||
: false,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user