chore: Add in some more files for the testing of the sdk and the rust interface

This commit is contained in:
J H
2024-03-13 16:23:24 -06:00
parent ba325b1581
commit b6fe0be1b2
46 changed files with 451 additions and 116 deletions

View File

@@ -57,7 +57,7 @@ export type Scheme = string | null
type AddSslOptions = {
scheme: Scheme
preferredExternalPort: number
addXForwardedHeaders?: boolean /** default: false */
addXForwardedHeaders: boolean | null /** default: false */
}
type Security = { secure: false; ssl: false } | { secure: true; ssl: boolean }
export type BindOptions = {
@@ -82,13 +82,13 @@ type BindOptionsByKnownProtocol =
| ({
protocol: ProtocolsWithSslVariants
preferredExternalPort?: number
scheme?: Scheme
scheme: Scheme | null
} & ({ noAddSsl: true } | { addSsl?: Partial<AddSslOptions> }))
| {
protocol: NotProtocolsWithSslVariants
preferredExternalPort?: number
scheme?: Scheme
addSsl?: AddSslOptions | null
scheme: Scheme | null
addSsl: AddSslOptions | null
}
type BindOptionsByProtocol = BindOptionsByKnownProtocol | BindOptions
@@ -185,6 +185,7 @@ export class Host {
if ("noAddSsl" in options && options.noAddSsl) return null
if ("withSsl" in protoInfo && protoInfo.withSsl)
return {
addXForwardedHeaders: null,
preferredExternalPort: knownProtocols[protoInfo.withSsl].defaultPort,
scheme: protoInfo.withSsl,
...("addSsl" in options ? options.addSsl : null),