Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dbc504f

Browse files
committed
feat: add cors_behavior to agent apps
1 parent f871a43 commit dbc504f

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

provider/app.go

+21
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,27 @@ func appResource() *schema.Resource {
258258
return diag.Errorf(`invalid "coder_app" open_in value, must be one of "tab", "slim-window": %q`, valStr)
259259
},
260260
},
261+
"cors_behavior": {
262+
Type: schema.TypeString,
263+
Description: "Determines the behavior of CORS headers for the app. Simple will allow apps to " +
264+
"communicate with other workspaces owned by the same user.",
265+
ForceNew: true,
266+
Optional: true,
267+
Default: "simple",
268+
ValidateDiagFunc: func(val interface{}, c cty.Path) diag.Diagnostics {
269+
valStr, ok := val.(string)
270+
if !ok {
271+
return diag.Errorf("expected string, got %T", val)
272+
}
273+
274+
switch valStr {
275+
case "passthru", "simple":
276+
return nil
277+
}
278+
279+
return diag.Errorf(`invalid "cors_behavior" open_in value, must be one of "passthru", "simple": %q`, valStr)
280+
},
281+
},
261282
},
262283
}
263284
}

0 commit comments

Comments
 (0)