Our route implementation which uses the CorsProxyHttpHandler.
상속: 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;
 }
예제 #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);
        }