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

PATCH requests over HTTP with local server not possible #428

Closed
nussjustin-hmmh opened this issue Feb 8, 2024 · 1 comment
Closed

PATCH requests over HTTP with local server not possible #428

nussjustin-hmmh opened this issue Feb 8, 2024 · 1 comment

Comments

@nussjustin-hmmh
Copy link

The github.com/soheilhy/cmux package used to handle both HTTP and HTTPS requests on the same port does not support the PATCH method.

Sending a PATCH method over HTTP will result in the request being treated as HTTPS and failing hard.

An example output when using curl:

> PATCH / HTTP/1.1
> Host: localhost:8000
> User-Agent: curl/8.2.1
> Content-Type: application/json
> Accept: application/json
> Content-Length: 120
> 
* Recv failure: Connection reset by peer
* Closing connection
curl: (56) Recv failure: Connection reset by peer

There is already an open issue about this in the cmux repository (soheilhy/cmux#99) but considering that the package has not been updated in 3 years it seems unlikely that the issue will be fixed there.

A possible solution would be to create a fork of the cmux package and add support for PATCH there.

I also looked for other similar packages but couldn't find one.

@tucksaun
Copy link
Contributor

tucksaun commented Feb 8, 2024

hi @nussjustin-hmmh

thank you for the report

it looks like we can simply add PATCH to the allowed method list for HTTP1Fast, see #429 for a fix

@fabpot fabpot closed this as completed in 03c431e Feb 9, 2024
fabpot added a commit that referenced this issue Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants