-
-
Notifications
You must be signed in to change notification settings - Fork 589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for fetch
and cbor
#797
Conversation
if (!headers['Accept']) { | ||
headers['Accept'] = 'application/json'; | ||
if (this.supportsCbor) { | ||
headers['Accept'] = `application/cbor, application/jsonq=0.9`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing semicolon before "q=0.9"
The related MSC hasn't gone anywhere for a few years but |
It appears that native |
Noteworthy that the v18+ implementation is provided by |
Closing this as it no longer applies cleanly |
Is the current intention still to go with fetch APIs across the board (last update I can see on the matter) or is still still up for reconsideration? |
Yes, fetch given native browser and node support |
This does quite a few sweeping changes to support
fetch
,CBOR encoding
and theAccept
header which is part of matrix-org/matrix-spec-proposals#1740. Please do not merge or review this just yetAnyway, this PR seems to work perfectly fine with a few issues noted below.
Notable failings:
supportsCbor
is always true, and not detected. Ergo, this PR breaks support for regular JSON servers.request
for fetch because I could not get ArrayBuffer responses out of it which is important.borc
is the library we are using forcbor
and is wasmy, untested, and seems to work most of the time.This change is marked as an internal change (Task), so will not be included in the changelog.