mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-10-31 10:37:24 -04:00 
			
		
		
		
	Allow duplicate Server headers when proxying response
See discussion on commit c9b022b5e0384ab97812366aade0bb34304459af If we overwrite the Server header, it becomes difficult/impossible to know from the client whether the request was proxied through Caddy.
This commit is contained in:
		
							parent
							
								
									7b5efb5d75
								
							
						
					
					
						commit
						43b56d621b
					
				| @ -413,9 +413,13 @@ func copyHeader(dst, src http.Header) { | |||||||
| 			if _, shouldSkip := skipHeaders[k]; shouldSkip { | 			if _, shouldSkip := skipHeaders[k]; shouldSkip { | ||||||
| 				continue | 				continue | ||||||
| 			} | 			} | ||||||
| 			// otherwise, overwrite | 			// otherwise, overwrite to avoid duplicated fields that can be | ||||||
|  | 			// problematic (see issue #1086) -- however, allow duplicate | ||||||
|  | 			// Server fields so we can see the reality of the proxying. | ||||||
|  | 			if k != "Server" { | ||||||
| 				dst.Del(k) | 				dst.Del(k) | ||||||
| 			} | 			} | ||||||
|  | 		} | ||||||
| 		for _, v := range vv { | 		for _, v := range vv { | ||||||
| 			dst.Add(k, v) | 			dst.Add(k, v) | ||||||
| 		} | 		} | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user