Ejemplo n.º 1
0
        public async Task <IActionResult> GetPenelo(string value, CancellationToken cancellationToken = new CancellationToken())
        {
            var penelo = _httpContextAccessor.HttpContext.Request.Headers["Origin"];

            if (penelo.ToString() == _configuration["Penelo"] || penelo.ToString() == "http://localhost:8080")
            {
                try
                {
                    var key    = _configuration["SimpleWebRTC:Key"];
                    var secret = _configuration["SimpleWebRTC:Secret"];
                    var x      = await ApplicationExtensions.Get <Penelo>(key, secret);

                    return(Ok(x));
                }
                catch
                {
                    return(BadRequest());
                }
            }
            else
            {
                return(BadRequest(new
                {
                    message = "Sorry, bro."
                }));
            }
        }