You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the same router handles REST API requests and http CONNECT requests, then it is not possible to use middleware.CleanPath. CleanPath will mess up ctx.RoutePath for typical http CONNECT URIs, which are of the format host:port. This causes go-chi to respond to CONNECT requests with 404 Not Found.
I need to use to a workaround like below to get it working. Fixing middleware.CleanPath to not do anything for CONNECT requests would be the correct fix.
@samiponkanenssh
Hi, I ran your script and test with provided format host:port, but seems it returns the expected response, not 404.
will you share the request for reproducing 404?
❯ curl localhost:8080/t/e///s/t/// -X CONNECT -I
HTTP/1.1 200 OK
Date: Sat, 20 May 2023 05:38:23 GMT
Content-Length: 0
❯ curl localhost:8080/t/e///s/t/// -X GET -I
HTTP/1.1 405 Method Not Allowed
Date: Sat, 20 May 2023 05:38:28 GMT
Content-Length: 0
❯ curl localhost:8080/ -X GET -I
HTTP/1.1 200 OK
Date: Sat, 20 May 2023 05:38:32 GMT
Content-Length: 0
If the same router handles REST API requests and http CONNECT requests, then it is not possible to use middleware.CleanPath. CleanPath will mess up
ctx.RoutePath
for typical http CONNECT URIs, which are of the formathost:port
. This causes go-chi to respond to CONNECT requests with 404 Not Found.I need to use to a workaround like below to get it working. Fixing middleware.CleanPath to not do anything for CONNECT requests would be the correct fix.
The text was updated successfully, but these errors were encountered: