Skip to content

Commit

Permalink
fixup! Add support for http protocol requests
Browse files Browse the repository at this point in the history
  • Loading branch information
tshemsedinov committed Jun 21, 2021
1 parent 9cf2be1 commit 7743daf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class Metacom extends EventEmitter {
const target = interfaceName + '/' + methodName;
const packet = { call: callId, [target]: args };
const dest = new URL(this.url);
const protocol = dest.protocol.endsWith('s') ? 'https' : 'http';
const protocol = dest.protocol === 'ws:' ? 'http' : 'https';
const url = `${protocol}://${dest.host}/api`;
return fetch(url, {
method: 'POST',
Expand Down

0 comments on commit 7743daf

Please sign in to comment.