mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-10-31 02:27:19 -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,8 +413,12 @@ func copyHeader(dst, src http.Header) { | ||||
| 			if _, shouldSkip := skipHeaders[k]; shouldSkip { | ||||
| 				continue | ||||
| 			} | ||||
| 			// otherwise, overwrite | ||||
| 			dst.Del(k) | ||||
| 			// 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) | ||||
| 			} | ||||
| 		} | ||||
| 		for _, v := range vv { | ||||
| 			dst.Add(k, v) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user