Skip to content

Commit

Permalink
fix: use http instead of https (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanwlee authored Apr 23, 2024
1 parent f474857 commit f4d2ed0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/web5/lib/src/dids/did_web/did_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class DidWeb {
}

final String documentUrl = Uri.decodeFull(did.id.replaceAll(':', '/'));
Uri? didUri = Uri.tryParse('https://$documentUrl');
Uri? didUri = Uri.tryParse('http://$documentUrl');

if (didUri == null) throw 'Unable to parse DID document Url $documentUrl';

Expand Down
20 changes: 6 additions & 14 deletions packages/web5/test/dids/did_web_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,12 @@ const validDidWebDocument = '''{
{
"id": "#linkeddomains",
"type": "LinkedDomains",
"serviceEndpoint": {
"origins": [
"https://www.linkedin.com/"
]
}
"serviceEndpoint": ["https://www.linkedin.com/"]
},
{
"id": "#hub",
"type": "IdentityHub",
"serviceEndpoint": {
"instances": [
"https://hub.did.msidentity.com/v1.0/658728e7-1632-412a-9815-fe53f53ec58b"
]
}
"serviceEndpoint": ["https://hub.did.msidentity.com/v1.0/658728e7-1632-412a-9815-fe53f53ec58b"]
}
],
"verificationMethod": [
Expand Down Expand Up @@ -116,7 +108,7 @@ void main() {
when(() => request.close()).thenAnswer((_) async => response);
when(
() => mockClient.getUrl(
Uri.parse('https://www.linkedin.com/.well-known/did.json'),
Uri.parse('http://www.linkedin.com/.well-known/did.json'),
),
).thenAnswer((_) async => request);

Expand All @@ -128,7 +120,7 @@ void main() {

verify(
() => mockClient
.getUrl(Uri.parse('https://www.linkedin.com/.well-known/did.json')),
.getUrl(Uri.parse('http://www.linkedin.com/.well-known/did.json')),
);
});

Expand All @@ -139,7 +131,7 @@ void main() {
when(() => request.close()).thenAnswer((_) async => response);
when(
() => mockClient.getUrl(
Uri.parse('https://www.remotehost.com:8892/ingress/did.json'),
Uri.parse('http://www.remotehost.com:8892/ingress/did.json'),
),
).thenAnswer((_) async => request);

Expand All @@ -152,7 +144,7 @@ void main() {

verify(
() => mockClient.getUrl(
Uri.parse('https://www.remotehost.com:8892/ingress/did.json'),
Uri.parse('http://www.remotehost.com:8892/ingress/did.json'),
),
);
});
Expand Down

0 comments on commit f4d2ed0

Please sign in to comment.