mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-10-30 10:12:45 -04:00 
			
		
		
		
	Merge pull request #927 from pedronasser/master
fix rewrite if problem (skip remaining args)
This commit is contained in:
		
						commit
						7eb4bb8e1c
					
				| @ -92,6 +92,7 @@ func rewriteParse(c *caddy.Controller) ([]Rule, error) { | |||||||
| 					} | 					} | ||||||
| 				default: | 				default: | ||||||
| 					if httpserver.IfMatcherKeyword(c.Val()) { | 					if httpserver.IfMatcherKeyword(c.Val()) { | ||||||
|  | 						c.RemainingArgs() | ||||||
| 						continue block | 						continue block | ||||||
| 					} | 					} | ||||||
| 					return nil, c.ArgErr() | 					return nil, c.ArgErr() | ||||||
|  | |||||||
| @ -179,6 +179,12 @@ func TestRewriteParse(t *testing.T) { | |||||||
| 		 }`, true, []Rule{ | 		 }`, true, []Rule{ | ||||||
| 			&ComplexRule{}, | 			&ComplexRule{}, | ||||||
| 		}}, | 		}}, | ||||||
|  | 		{`rewrite { | ||||||
|  | 			if {path} match / | ||||||
|  | 			to		/to | ||||||
|  | 		 }`, false, []Rule{ | ||||||
|  | 			&ComplexRule{Base: "/", To: "/to"}, | ||||||
|  | 		}}, | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	for i, test := range regexpTests { | 	for i, test := range regexpTests { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user