HasBehavior returns true if the given context has the specified CORS behavior.
(ctx context.Context, behavior codersdk.CORSBehavior)
| 15 | |
| 16 | // HasBehavior returns true if the given context has the specified CORS behavior. |
| 17 | func 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 | } |
no test coverage detected