Skip to content

Commit

Permalink
fix: use URL.toString() instead of .href which is undefined in browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
birme committed Jul 5, 2023
1 parent 138089e commit e0db6cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/adapters/EyevinnAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export class EyevinnAdapter implements Adapter {
this.waitingForCandidates = false;
clearTimeout(this.iceGatheringTimeout);

const response = await fetch(this.channelUrl.href, {
const response = await fetch(this.channelUrl.toString(), {
method: 'POST',
headers: {
'Content-Type': 'application/json'
Expand Down
7 changes: 4 additions & 3 deletions src/adapters/WHEPAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ export class WHEPAdapter implements Adapter {

private async requestOffer() {
if (this.whepType === WHEPType.Server) {
this.log(`Requesting offer from: ${this.channelUrl.href}`);
const response = await fetch(this.channelUrl.href, {
this.log(`Requesting offer from: ${this.channelUrl}`);
const response = await fetch(this.channelUrl.toString(), {
method: 'POST',
headers: {
'Content-Type': 'application/sdp'
Expand Down Expand Up @@ -200,7 +200,8 @@ export class WHEPAdapter implements Adapter {
const offer = this.localPeer.localDescription;

if (this.whepType === WHEPType.Client && offer) {
const response = await fetch(this.channelUrl.href, {
this.log(`Sending offer to ${this.channelUrl}`);
const response = await fetch(this.channelUrl.toString(), {
method: 'POST',
headers: {
'Content-Type': 'application/sdp'
Expand Down

0 comments on commit e0db6cd

Please sign in to comment.