File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,12 @@ pub struct Cors {
1111    allowed_headers :  HashSet < HeaderName > , 
1212    max_age :  Option < u64 > , 
1313    allowed_methods :  HashSet < http:: Method > , 
14-     origins_str :  String , 
1514    origins :  Option < HashSet < HeaderValue > > , 
1615} 
1716
1817/// It builds a new CORS instance. 
1918pub  fn  new ( origins_str :  String )  -> Option < Arc < Configured > >  { 
20-     let  cors = Cors :: new ( origins_str . clone ( ) ) ; 
19+     let  cors = Cors :: new ( ) ; 
2120    let  cors = if  origins_str. is_empty ( )  { 
2221        None 
2322    }  else  if  origins_str == "*"  { 
@@ -41,13 +40,12 @@ pub fn new(origins_str: String) -> Option<Arc<Configured>> {
4140
4241impl  Cors  { 
4342    /// Creates a new Cors instance. 
44- pub  fn  new ( origins_str :   String )  -> Self  { 
43+ pub  fn  new ( )  -> Self  { 
4544        Self  { 
4645            origins :  None , 
4746            allowed_headers :  HashSet :: new ( ) , 
4847            allowed_methods :  HashSet :: new ( ) , 
4948            max_age :  None , 
50-             origins_str, 
5149        } 
5250    } 
5351
@@ -121,7 +119,7 @@ impl Cors {
121119
122120impl  Default  for  Cors  { 
123121    fn  default ( )  -> Self  { 
124-         Self :: new ( "*" . to_owned ( ) ) 
122+         Self :: new ( ) 
125123    } 
126124} 
127125
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments