Skip to content

Conversation

@sandhose
Copy link
Member

@sandhose sandhose commented Apr 8, 2025

Fixes #4340

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Apr 8, 2025

Deploying matrix-authentication-service-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7f4e975
Status: ✅  Deploy successful!
Preview URL: https://a06531ec.matrix-authentication-service-docs.pages.dev
Branch Preview URL: https://quenting-compat-no-content-t.matrix-authentication-service-docs.pages.dev

View logs

@sandhose sandhose requested a review from reivilibre April 8, 2025 14:42
@sandhose sandhose added A-Compatibility-Layer Related to the legacy Matrix authentication compatibility layer A-Spec-Compliance Divergence from the Matrix or the OAuth 2.0/OIDC specifications labels Apr 8, 2025
Comment on lines 144 to 145
serde_json::from_slice(&bytes).map_err(MatrixJsonBodyRejection::NotJson)?;
let value = serde_json::from_value(value).map_err(MatrixJsonBodyRejection::BadJson)?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess these requests are tiny so this is fine. But if they were big, I'd rather avoid this and you could use .is_syntax() on the serde_json Error.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, better do that. I used .is_data() instead

7f4e975

@sandhose sandhose enabled auto-merge April 8, 2025 16:13
@sandhose sandhose merged commit 1e4ce8f into main Apr 8, 2025
21 checks passed
@sandhose sandhose deleted the quenting/compat-no-content-type branch April 8, 2025 16:19
@sandhose sandhose added the T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks. label Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Compatibility-Layer Related to the legacy Matrix authentication compatibility layer A-Spec-Compliance Divergence from the Matrix or the OAuth 2.0/OIDC specifications T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

compat login spec compliance: Content-Type: application/json should be optional, but MAS requires it

2 participants