TUN-3484: OriginService that responds with configured HTTP status

This commit is contained in:
Adam Chalmers
2020-11-04 12:22:21 -06:00
parent d01770107e
commit bc015995d8
4 changed files with 78 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ ingress:
func Test_parseIngress(t *testing.T) {
localhost8000 := MustParseURL(t, "https://localhost:8000")
localhost8001 := MustParseURL(t, "https://localhost:8001")
fourOhFour := newStatusCode(404)
defaultConfig := setConfig(originRequestFromYAML(config.OriginRequestConfig{}), config.OriginRequestConfig{})
require.Equal(t, defaultKeepAliveConnections, defaultConfig.KeepAliveConnections)
type args struct {
@@ -172,6 +173,20 @@ ingress:
`},
wantErr: true,
},
{
name: "Valid HTTP status",
args: args{rawYAML: `
ingress:
- service: http_status:404
`},
want: []Rule{
{
Hostname: "",
Service: &fourOhFour,
Config: defaultConfig,
},
},
},
{
name: "Valid hello world service",
args: args{rawYAML: `