mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: avoid redirect loop on workspace proxies (#9389)
* fix: avoid redirect loop on workspace proxies --------- Co-authored-by: Steven Masley <stevenmasley@coder.com>
This commit is contained in:
co-authored by
Steven Masley
parent
eb68684327
commit
5993f85ec9
@@ -15,6 +15,7 @@ func Test_RequestValidate(t *testing.T) {
|
||||
cases := []struct {
|
||||
name string
|
||||
req workspaceapps.Request
|
||||
noNormalize bool
|
||||
errContains string
|
||||
}{
|
||||
{
|
||||
@@ -90,6 +91,7 @@ func Test_RequestValidate(t *testing.T) {
|
||||
AgentNameOrID: "baz",
|
||||
AppSlugOrPort: "qux",
|
||||
},
|
||||
noNormalize: true,
|
||||
errContains: "base path is required",
|
||||
},
|
||||
{
|
||||
@@ -215,7 +217,10 @@ func Test_RequestValidate(t *testing.T) {
|
||||
c := c
|
||||
t.Run(c.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
req := c.req.Normalize()
|
||||
req := c.req
|
||||
if !c.noNormalize {
|
||||
req = c.req.Normalize()
|
||||
}
|
||||
err := req.Validate()
|
||||
if c.errContains == "" {
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user