Our route implementation which uses the CorsProxyHttpHandler.
Inheritance: System.Web.Routing.Route
 /// <summary>
 /// Activates the CorsProxy.
 /// </summary>
 /// <param name="routes"></param>
 /// <param name="url">Default route is "corsproxy/". It's the URI that the Ajax request must redirect to</param>
 public static CorsProxyRoute EnableCorsProxy(this RouteCollection routes, string url = "corsproxy/")
 {
     if (routes == null) throw new ArgumentNullException("routes");
     if (url == null) throw new ArgumentNullException("url");
     var route = new CorsProxyRoute(url);
     routes.Add(route);
     return route;
 }
Esempio n. 2
0
        /// <summary>
        /// Activates the CorsProxy.
        /// </summary>
        /// <param name="routes"></param>
        /// <param name="url">Default route is "corsproxy/". It's the URI that the Ajax request must redirect to</param>
        public static CorsProxyRoute EnableCorsProxy(this RouteCollection routes, string url = "corsproxy/")
        {
            if (routes == null)
            {
                throw new ArgumentNullException("routes");
            }
            if (url == null)
            {
                throw new ArgumentNullException("url");
            }
            var route = new CorsProxyRoute(url);

            routes.Add(route);
            return(route);
        }