WithBehavior sets the CORS behavior for the given context.
(ctx context.Context, behavior codersdk.CORSBehavior)
| 10 | |
| 11 | // WithBehavior sets the CORS behavior for the given context. |
| 12 | func WithBehavior(ctx context.Context, behavior codersdk.CORSBehavior) context.Context { |
| 13 | return context.WithValue(ctx, contextKeyBehavior{}, behavior) |
| 14 | } |
| 15 | |
| 16 | // HasBehavior returns true if the given context has the specified CORS behavior. |
| 17 | func HasBehavior(ctx context.Context, behavior codersdk.CORSBehavior) bool { |
no outgoing calls
no test coverage detected