Skip to content
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

Fix: support 405 from POST /messages in broadcast fallback #60

Merged
merged 1 commit into from
Sep 19, 2023

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`.
@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
10 checks passed
@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.

3 participants