@@ -2,14 +2,11 @@ use Test::More;
2
2
use Test ::Exception;
3
3
use Test ::Deep;
4
4
use Search::Elasticsearch::Async;
5
- use MIME::Base64;
6
5
7
6
sub is_cxn (@);
8
7
9
8
my $ username = ' ThisIsAVeryLongUsernameAndThatIsOKYouSee' ;
10
9
my $ password = ' CorrectHorseBatteryStapleCorrectHorseBatteryStaple' ;
11
- my $ userinfo = " $ username :$ password" ;
12
- my $ userinfo_b64 = MIME::Base64::encode_base64( $ userinfo , " " );
13
10
14
11
# ## Scalar nodes ###
15
12
@@ -35,14 +32,6 @@ is_cxn "Path",
35
32
new_cxn( nodes => ' foo/bar' ),
36
33
{ host => ' foo' , port => ' 80' , uri => ' http://foo:80/bar' };
37
34
38
- is_cxn " Userinfo" , new_cxn( nodes => " http://$ userinfo \@localhost/" ),
39
- {
40
- port => ' 80' ,
41
- uri => ' http://localhost:80' ,
42
- default_headers => { Authorization => " Basic $ userinfo_b64" },
43
- userinfo => $ userinfo
44
- };
45
-
46
35
is_cxn " IPv4" ,
47
36
new_cxn( nodes => ' 127.0.0.1' ),
48
37
{ host => ' 127.0.0.1' , port => ' 80' , uri => ' http://127.0.0.1:80' };
@@ -67,30 +56,6 @@ is_cxn "Scheme:IPv4:Port", new_cxn( nodes => 'https://127.0.0.1:1000' ),
67
56
scheme => ' https'
68
57
};
69
58
70
- is_cxn " IPv6" ,
71
- new_cxn( nodes => ' ::1' ),
72
- { host => ' ::1' , port => ' 80' , uri => ' http://[::1]:80' };
73
-
74
- is_cxn " Scheme:IPv6" , new_cxn( nodes => ' https://[::1]' ),
75
- {
76
- host => ' ::1' ,
77
- port => ' 443' ,
78
- uri => ' https://[::1]:443' ,
79
- scheme => ' https'
80
- };
81
-
82
- is_cxn " IPv6:Port" ,
83
- new_cxn( nodes => ' [::1]:1000' ),
84
- { host => ' ::1' , port => ' 1000' , uri => ' http://[::1]:1000' };
85
-
86
- is_cxn " Scheme:IPv6:Port" , new_cxn( nodes => ' https://[::1]:1000' ),
87
- {
88
- host => ' ::1' ,
89
- port => ' 1000' ,
90
- uri => ' https://[::1]:1000' ,
91
- scheme => ' https'
92
- };
93
-
94
59
# ## Options with scalar ###
95
60
96
61
is_cxn " HTTPS option" , new_cxn( nodes => ' foo' , use_https => 1 ),
@@ -121,28 +86,6 @@ is_cxn "Path option with settings",
121
86
new_cxn( nodes => ' foo/baz/' , path_prefix => ' /bar/' ),
122
87
{ host => ' foo' , port => 80 , uri => ' http://foo:80/baz' };
123
88
124
- is_cxn " Userinfo option" , new_cxn( nodes => ' foo' , userinfo => $ userinfo ),
125
- {
126
- host => ' foo' ,
127
- port => 80 ,
128
- uri => ' http://foo:80' ,
129
- default_headers => { Authorization => " Basic $ userinfo_b64" },
130
- userinfo => $ userinfo
131
- };
132
-
133
- is_cxn " Userinfo option with settings" ,
134
-
135
- # Note that userinfo as specified is explicitly different to that
136
- # provided in the nodes string
137
- new_cxn( nodes => " $ userinfo \@foo" , userinfo => ' foo:baz' ),
138
- {
139
- host => ' foo' ,
140
- port => 80 ,
141
- uri => ' http://foo:80' ,
142
- default_headers => { Authorization => " Basic $ userinfo_b64" },
143
- userinfo => $ userinfo
144
- };
145
-
146
89
is_cxn " Deflate option" ,
147
90
new_cxn( deflate => 1 ),
148
91
{ default_headers => { ' Accept-Encoding' => ' deflate' } };
@@ -151,10 +94,6 @@ is_cxn "IPv4 with Port",
151
94
new_cxn( nodes => ' 127.0.0.1' , port => 456 ),
152
95
{ host => ' 127.0.0.1' , port => ' 456' , uri => ' http://127.0.0.1:456' };
153
96
154
- is_cxn " IPv6 with Port" ,
155
- new_cxn( nodes => ' ::1' , port => 456 ),
156
- { host => ' ::1' , port => ' 456' , uri => ' http://[::1]:456' };
157
-
158
97
# ## Hash ###
159
98
is_cxn " Hash host" ,
160
99
new_cxn( nodes => { host => ' foo' } ),
@@ -172,10 +111,6 @@ is_cxn "Hash IPv4 host",
172
111
new_cxn( nodes => { host => ' 127.0.0.1' } ),
173
112
{ host => ' 127.0.0.1' , port => 80 , uri => ' http://127.0.0.1:80' };
174
113
175
- is_cxn " Hash IPv6 host" ,
176
- new_cxn( nodes => { host => ' ::1' } ),
177
- { host => ' ::1' , port => 80 , uri => ' http://[::1]:80' };
178
-
179
114
# Build URI
180
115
is new_cxn()-> build_uri( { path => ' /' } ), ' http://localhost:9200/' ,
181
116
" Default URI" ;
0 commit comments