Example #1
0
 /// <summary>
 /// CORS endpoint behavior as configured from endpoint behavior
 /// </summary>
 public CorsEndpointBehavior(XElement xe)
 {
     if (xe == null)
     {
         throw new InvalidOperationException("Missing CorsEndpointBehaviorConfiguration");
     }
     using (var sr = new StringReader(xe.ToString()))
         this.m_settings = XmlModelSerializerFactory.Current.CreateSerializer(typeof(CorsEndpointBehaviorConfiguration)).Deserialize(sr) as CorsEndpointBehaviorConfiguration;
 }
Example #2
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public CorsEndpointBehavior()
 {
     this.m_settings = new CorsEndpointBehaviorConfiguration();
     this.m_settings.Resource.Add(new CorsResourceSetting("*", "*", new String[] { "GET", "POST", "HEAD", "PUT", "PATCH", "OPTIONS" }, new String[] { "Content-Type", "Accept-Encoding", "Content-Encoding" }));
 }
Example #3
0
 /// <summary>
 /// Creates a new CORS endpoint behavior
 /// </summary>
 public CorsEndpointBehavior(CorsEndpointBehaviorConfiguration settings)
 {
     this.m_settings = settings;
 }