Comments (4)
Citation needed, for both claims.
I see this text in the spec:
The
Content-Type
for this response SHOULD beapplication/json
, however servers parsing the response should assume that the body is JSON regardless of type.
(https://spec.matrix.org/v1.9/server-server-api/#getwell-knownmatrixserver)
from matrix-federation-tester.
Claim No1:
I have tested it both with the matrix.org hosted version of the federation tester, as well as the federationtester built from main seconds ago, and both attested me a working federation. I tested it with my current project (which is not a real homeserver). It's hard to prove without revealing the domain, but I got the following output during testing just now:
❯ curl 'http://127.0.0.1:8080/api/federation-ok?server_name=<my.test.domain>'
GOOD
❯ curl https://<my.test.domain>/_matrix/key/v2/server -v 2>&1 | grep content-type
< content-type: application/octet-stream
I have removed the domain, as it was a very temporary setup that will not be consistently reachable anyways.
Claim No2:
You are right, it seems like the well-known is exempt from the content-type rule (as per your quoted part of the spec), however I would argue the /_matrix/key/v2/server
endpoint would have to set a content-type of application/json.
all endpoints in this specification require the destination server to return a JSON object. Servers must include a Content-Type header of application/json for all JSON responses.
(https://spec.matrix.org/v1.9/server-server-api/#api-standards)
from matrix-federation-tester.
Synapse does actually check the content-type at the key endpoint but not at the well-known endpoint.
2024-03-07 22:21:39,759 - synapse.http.federation.well_known_resolver - 197 - INFO - ServerKeyFetcher-1036- - Response from .well-known: {'m.server': '<my.test.domain>:443'}
2024-03-07 22:21:39,832 - synapse.http.matrixfederationclient - 341 - WARNING - ServerKeyFetcher-1036 - {GET-O-4890} [<my.test.domain>] Error reading response GET matrix-federation://<my.test.domain>/_matrix/key/v2/server: Failed to send request: RuntimeError: Remote server sent Content-Type header of 'application/octet-stream', not 'application/json'
from matrix-federation-tester.
sorry, the "both claims" I was referring to were that (1) the spec and (2) servers require application/json
for the .well-known
file.
I think you're right about it for /_matrix/key/v2/server
. The relevant bit of spec is here:
Servers must include a
Content-Type
header ofapplication/json
for all JSON responses.
[edit: which you already linked! sorry]
from matrix-federation-tester.
Related Issues (20)
- federation tester incorrectly says it times out when .well-known has a time-out, but an SRV record is present HOT 4
- federation tester does not return valid result HOT 3
- DNS SRV record present but version is still fetched from main domain HOT 2
- All green report for v4 and v6 even if well-known is only reachable via v6 HOT 2
- federation tester started to complain about wildcard ssl certificate HOT 7
- Version request does not honour delegation
- [HELP REQUIRED] Non-200 response 404 from remote server HOT 11
- Query authoritative DNS Server for SRV record HOT 1
- API that returns a simple indicator whether the federation is okay HOT 3
- Federation is using wrong hostname even if SRV record seems correct HOT 3
- federation-tester is querying regularly on ip:8448 instead honoring hostname/domain and well-known HOT 1
- Does certificate error prevent other servers from getting room information? HOT 1
- Plain text endpoint does not work on matrix.org instance HOT 3
- Documentation on usage with prometheus HOT 1
- Feature request: Add prometheus formatted output
- Federation tester can't find .well-known file HOT 2
- IPv6 only main site and dual stack matrix server HOT 2
- Wrong SNI header gets set. HOT 2
- 404 link HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from matrix-federation-tester.