Skip to content

Commit 6425574

Browse files
authored
feat(lb): add header host in match route (#377)
1 parent 9e02d3c commit 6425574

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

packages/clients/src/api/lb/v1/marshalling.gen.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ const unmarshalRouteMatch = (data: unknown) => {
463463
)
464464
}
465465

466-
return { sni: data.sni } as RouteMatch
466+
return { hostHeader: data.host_header, sni: data.sni } as RouteMatch
467467
}
468468

469469
export const unmarshalAcl = (data: unknown) => {
@@ -903,7 +903,16 @@ const marshalRouteMatch = (
903903
request: RouteMatch,
904904
defaults: DefaultValues,
905905
): Record<string, unknown> => ({
906-
sni: request.sni,
906+
...resolveOneOf([
907+
{
908+
param: 'sni',
909+
value: request.sni,
910+
},
911+
{
912+
param: 'host_header',
913+
value: request.hostHeader,
914+
},
915+
]),
907916
})
908917

909918
const marshalSubscriberEmailConfig = (

packages/clients/src/api/lb/v1/types.gen.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,9 +728,18 @@ export interface Route {
728728
export interface RouteMatch {
729729
/**
730730
* Server Name Indication TLS extension (SNI) field from an incoming
731-
* connection made via an SSL/TLS transport layer
731+
* connection made via an SSL/TLS transport layer.
732+
*
733+
* One-of ('matchType'): at most one of 'sni', 'hostHeader' could be set.
732734
*/
733735
sni?: string
736+
/**
737+
* The Host request header specifies the host of the server to which the
738+
* request is being sent.
739+
*
740+
* One-of ('matchType'): at most one of 'sni', 'hostHeader' could be set.
741+
*/
742+
hostHeader?: string
734743
}
735744

736745
/** Set acls response */

0 commit comments

Comments
 (0)