@@ -91,11 +91,15 @@ void main() {
91
91
final httpClient = CustomHttpClient ();
92
92
final postgrest = PostgrestClient (rootUrl, httpClient: httpClient);
93
93
94
- await postgrest.rpc ('func' ).setHeader ("myKey" , "myValue" ).select ();
94
+ await postgrest
95
+ .rpc ('empty-succ' )
96
+ .setHeader ("myKey" , "myValue" )
97
+ .select ()
98
+ .head ();
95
99
expect (httpClient.lastRequest! .headers, containsPair ("myKey" , "myValue" ));
96
100
97
101
// Other following requests should not have the header
98
- await postgrest.rpc ('func ' ).select ();
102
+ await postgrest.rpc ('empty-succ ' ).select (). head ();
99
103
expect (httpClient.lastRequest! .headers,
100
104
isNot (containsPair ("myKey" , "myValue" )));
101
105
});
@@ -104,11 +108,15 @@ void main() {
104
108
final httpClient = CustomHttpClient ();
105
109
final postgrest = PostgrestClient (rootUrl, httpClient: httpClient);
106
110
107
- await postgrest.from ('users' ).setHeader ("myKey" , "myValue" ).select ();
111
+ await postgrest
112
+ .from ('empty-succ' )
113
+ .setHeader ("myKey" , "myValue" )
114
+ .select ()
115
+ .head ();
108
116
expect (httpClient.lastRequest! .headers, containsPair ("myKey" , "myValue" ));
109
117
110
118
// Other following requests should not have the header
111
- await postgrest.from ('users ' ).select ();
119
+ await postgrest.from ('empty-succ ' ).select (). head ();
112
120
expect (httpClient.lastRequest! .headers,
113
121
isNot (containsPair ("myKey" , "myValue" )));
114
122
});
0 commit comments