mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-31 04:33:40 +00:00
feat: Origins can be null
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
export class Origin {
|
||||
constructor(readonly protocol: string, readonly host: string) {}
|
||||
constructor(readonly protocol: string | null, readonly host: string) {}
|
||||
|
||||
withAuth(
|
||||
origin?:
|
||||
@@ -13,6 +13,7 @@ export class Origin {
|
||||
// prettier-ignore
|
||||
const urlAuth = !!(origin) ? `${origin.username}${origin.password != null ?`:${origin.password}`:''}@` :
|
||||
'';
|
||||
return `${this.protocol}://${urlAuth}${this.host}`
|
||||
const protocolSection = this.protocol != null ? `${this.protocol}://` : ""
|
||||
return `${protocolSection}${urlAuth}${this.host}`
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user