mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +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 => {
|
addresses.forEach(url => {
|
||||||
if (h.kind === 'onion') {
|
if (h.kind === 'onion') {
|
||||||
tor.push({
|
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,
|
url,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@@ -128,5 +130,5 @@ export type LocalAddress = {
|
|||||||
|
|
||||||
export type TorAddress = {
|
export type TorAddress = {
|
||||||
url: string
|
url: string
|
||||||
protocol: string
|
protocol: string | null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,10 +54,12 @@ export class OSService {
|
|||||||
serverId: id,
|
serverId: id,
|
||||||
})
|
})
|
||||||
|
|
||||||
const [latest, _] = Object.entries(this.osUpdate).at(-1)!
|
const latest = Object.entries(this.osUpdate).at(-1)?.[0]
|
||||||
|
|
||||||
this.updateAvailable$.next(
|
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