MCPcopy Index your code
hub / github.com/coder/coder / HasBehavior

Function HasBehavior

coderd/workspaceapps/cors/cors.go:17–21  ·  view source on GitHub ↗

HasBehavior returns true if the given context has the specified CORS behavior.

(ctx context.Context, behavior codersdk.CORSBehavior)

Source from the content-addressed store, hash-verified

15
16// HasBehavior returns true if the given context has the specified CORS behavior.
17func HasBehavior(ctx context.Context, behavior codersdk.CORSBehavior) bool {
18 val := ctx.Value(contextKeyBehavior{})
19 b, ok := val.(codersdk.CORSBehavior)
20 return ok && b == behavior
21}

Callers 1

proxyWorkspaceAppMethod · 0.92

Calls 1

ValueMethod · 0.45

Tested by

no test coverage detected