Skip to content

Commit a847197

Browse files
committed
Updated to latest http and http_retry library versions
1 parent 9676af1 commit a847197

File tree

3 files changed

+25
-8
lines changed

3 files changed

+25
-8
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,23 @@ main() async {
3232
}
3333
```
3434

35+
## Running the tests
36+
37+
To run the tests set the following environment variables:
38+
39+
```shell
40+
$ export DERIVA_TEST_HOSTNAME=deriva.example.org
41+
$ export DERIVA_TEST_CATALOG=1
42+
$ export DERIVA_TEST_CREDENTIAL=123456789012345678901234
43+
```
44+
45+
Then run the dart test command.
46+
47+
```shell
48+
$ dart test
49+
00:03 +7: All tests passed!
50+
```
51+
3552
## Features and bugs
3653

3754
Please file feature requests and bugs at the [issue tracker][tracker].

lib/src/deriva_base.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class DerivaBinding {
8585
/// returns the server cookie token.
8686
Future<String> _postAuthnSession() async {
8787
// Post credential to the server
88-
var response = await client.post('https://${this.hostname}/authn/session', body: credential);
88+
var response = await client.post(Uri.parse('https://${this.hostname}/authn/session'), body: credential);
8989
if (response.statusCode != 200) {
9090
throw http.ClientException('Authentication Failure: ${response.body}');
9191
}
@@ -128,7 +128,7 @@ class DerivaBinding {
128128
throw ArgumentError("Invalid path: null or '' not allowed");
129129
}
130130

131-
var response = await client.get('https://${hostname}${path}', headers: headers);
131+
var response = await client.get(Uri.parse('https://${hostname}${path}'), headers: headers);
132132
if (response.statusCode < 200 || response.statusCode >= 300) {
133133
throw http.ClientException('Failed to get "${path}": ${response.body}');
134134
}
@@ -139,7 +139,7 @@ class DerivaBinding {
139139
Future<Object> post(String path, {Object data, Map<String, String> headers}) async {
140140
headers = await _updateAuthorizationHeader(headers);
141141

142-
var response = await client.post('https://${hostname}${path}', body: data, headers: headers);
142+
var response = await client.post(Uri.parse('https://${hostname}${path}'), body: data, headers: headers);
143143
if (response.statusCode < 200 || response.statusCode >= 300) {
144144
throw http.ClientException('Failed to post "${path}": ${response.body}');
145145
}
@@ -150,7 +150,7 @@ class DerivaBinding {
150150
Future<Object> put(String path, {Object data, Map<String, String> headers}) async {
151151
headers = await _updateAuthorizationHeader(headers);
152152

153-
var response = await client.put('https://${hostname}${path}', body: data, headers: headers);
153+
var response = await client.put(Uri.parse('https://${hostname}${path}'), body: data, headers: headers);
154154
if (response.statusCode < 200 || response.statusCode >= 300) {
155155
throw http.ClientException('Failed to post "${path}": ${response.body}');
156156
}
@@ -171,7 +171,7 @@ class DerivaBinding {
171171
throw ArgumentError("Invalid path: null or '' not allowed");
172172
}
173173

174-
var response = await client.delete('https://${hostname}${path}', headers: headers);
174+
var response = await client.delete(Uri.parse('https://${hostname}${path}'), headers: headers);
175175
if (response.statusCode < 200 || response.statusCode >= 300) {
176176
throw http.ClientException('Failed to delete "${path}": ${response.body}');
177177
}

pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
name: deriva
2-
version: 0.0.2
2+
version: 0.2.0
33
description: Dart API for the DERIVA platform.
44
homepage: https://deriva.isi.edu
55

66
environment:
77
sdk: '>=2.2.0 <3.0.0'
88

99
dependencies:
10-
http: ^0.12.0+2
11-
http_retry: ^0.1.1+3
10+
http: ^0.13.0
11+
http_retry: ^0.2.0
1212

1313
dev_dependencies:
1414
pedantic: ^1.0.0

0 commit comments

Comments
 (0)