fn validate_origin( origin: Option<&HeaderValue>, allowed_patterns: &[String], ) -> Result<(), StatusCode>