From 6f35cd7ace074d7ea2b29c362d0ffbe531e3455e Mon Sep 17 00:00:00 2001 From: Cameron Elliott <868689+cameronelliott@users.noreply.github.com> Date: Fri, 19 Jan 2024 02:01:03 -0800 Subject: [PATCH] Don't throw Error on fetch PATCH 501, 405 status (#12) --- whep.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/whep.js b/whep.js index 9e00b4e..a3d9249 100644 --- a/whep.js +++ b/whep.js @@ -380,7 +380,7 @@ export class WHEPClient extends EventTarget body: fragment, headers }); - if (!fetched.ok) + if (!fetched.ok && fetched.status != 501 && fetched.status != 405) throw new Error("Request rejected with status " + fetched.status) //If we have got an answer for the ice restart @@ -521,4 +521,4 @@ export class WHEPClient extends EventTarget headers }); } -}; \ No newline at end of file +};