mirror of https://github.com/v2ray/v2ray-core
				
				
				
			update http header test
							parent
							
								
									7709ee9b7f
								
							
						
					
					
						commit
						13ed4b8429
					
				|  | @ -57,7 +57,31 @@ func TestRequestHeader(t *testing.T) { | |||
| func TestConnection(t *testing.T) { | ||||
| 	assert := With(t) | ||||
| 
 | ||||
| 	auth, err := NewHttpAuthenticator(context.Background(), new(Config)) | ||||
| 	auth, err := NewHttpAuthenticator(context.Background(), &Config{ | ||||
| 		Request: &RequestConfig{ | ||||
| 			Method: &Method{Value: "Post"}, | ||||
| 			Uri:    []string{"/testpath"}, | ||||
| 			Header: []*Header{ | ||||
| 				{ | ||||
| 					Name:  "Host", | ||||
| 					Value: []string{"www.v2ray.com", "www.google.com"}, | ||||
| 				}, | ||||
| 				{ | ||||
| 					Name:  "User-Agent", | ||||
| 					Value: []string{"Test-Agent"}, | ||||
| 				}, | ||||
| 			}, | ||||
| 		}, | ||||
| 		Response: &ResponseConfig{ | ||||
| 			Version: &Version{ | ||||
| 				Value: "1.1", | ||||
| 			}, | ||||
| 			Status: &Status{ | ||||
| 				Code:   "404", | ||||
| 				Reason: "Not Found", | ||||
| 			}, | ||||
| 		}, | ||||
| 	}) | ||||
| 	assert(err, IsNil) | ||||
| 
 | ||||
| 	listener, err := net.Listen("tcp", "127.0.0.1:0") | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 Darien Raymond
						Darien Raymond