You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-07-30 04:23:07 +03:00
Fall back to the unstable endpoint if we receive a 405 status
This commit is contained in:
@ -417,7 +417,7 @@ describe("MatrixClient", function () {
|
||||
]);
|
||||
});
|
||||
|
||||
it("should fallback to unstable endpoint when no support for stable endpoint", async () => {
|
||||
it("should fallback to unstable endpoint when stable endpoint 404s", async () => {
|
||||
await assertRequestsMade([
|
||||
{
|
||||
prefix: ClientPrefix.V1,
|
||||
@ -433,6 +433,22 @@ describe("MatrixClient", function () {
|
||||
]);
|
||||
});
|
||||
|
||||
it("should fallback to unstable endpoint when stable endpoint 405s", async () => {
|
||||
await assertRequestsMade([
|
||||
{
|
||||
prefix: ClientPrefix.V1,
|
||||
error: {
|
||||
httpStatus: 405,
|
||||
errcode: "M_UNRECOGNIZED",
|
||||
},
|
||||
},
|
||||
{
|
||||
prefix: unstableMSC3030Prefix,
|
||||
data: { event_id: eventId },
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it("should not fallback to unstable endpoint when stable endpoint returns an error", async () => {
|
||||
await assertRequestsMade(
|
||||
[
|
||||
|
Reference in New Issue
Block a user