add request header override option
This commit is contained in:
		
					parent
					
						
							
								e16ad423d5
							
						
					
				
			
			
				commit
				
					
						b0a9b6b5f8
					
				
			
		
					 10 changed files with 104 additions and 18 deletions
				
			
		
							
								
								
									
										16
									
								
								src/proxy/backend_opt.rs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								src/proxy/backend_opt.rs
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,16 @@ | |||
| use crate::error::*; | ||||
| 
 | ||||
| #[derive(Debug, Clone, Hash, Eq, PartialEq)] | ||||
| pub enum UpstreamOption { | ||||
|   OverrideHost, | ||||
|   // TODO: Adds more options for heder override
 | ||||
| } | ||||
| impl TryFrom<&str> for UpstreamOption { | ||||
|   type Error = anyhow::Error; | ||||
|   fn try_from(val: &str) -> Result<Self> { | ||||
|     match val { | ||||
|       "override_host" => Ok(Self::OverrideHost), | ||||
|       _ => Err(anyhow!("Unsupported header option")), | ||||
|     } | ||||
|   } | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Jun Kurihara
				Jun Kurihara