Skip to content

Conversation

@odesenfans
Copy link
Contributor

Problem: a user reports that publishing a message falls because of a 405 error returned from POST /messages. The fallback only takes 404 into account, but a 405 is actually more likely because GET /messages exists.

Solution: accept both 404 and 405 as a sign that the node does not support POST /messages.

Problem: a user reports that publishing a message falls because of a 405
error returned from `POST /messages`. The fallback only takes 404 into
account, but a 405 is actually more likely because `GET /messages` exists.

Solution: accept both 404 and 405 as a sign that the node does not
support `POST /messages`.
@odesenfans odesenfans requested a review from nesitor September 13, 2023 10:12
@hoh
Copy link
Member

hoh commented Sep 18, 2023

From the spec:

The server must generate an Allow header field in a 405 status code response. The field must contain a list of methods that the target resource currently supports.

Is this the case on pyaleph @odesenfans ?

Source: https://developer.mozilla.org/en-US/docs/web/http/status/405

@odesenfans
Copy link
Contributor Author

@hoh yes, this is managed by aiohttp:

curl -i -X POST api2.aleph.im/
HTTP/1.1 405 Method Not Allowed
Server: nginx/1.17.6
Date: Mon, 18 Sep 2023 16:35:24 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 23
Connection: keep-alive
Allow: GET,HEAD,OPTIONS

@hoh hoh merged commit 01e891a into main Sep 19, 2023
@MHHukiewitz MHHukiewitz deleted the od-support-405-in-broadcast-fallback branch September 25, 2023 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants