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
Describe the bug
I have a service A and a service B. Service A is invoking a method in B. I can successfully invoke the method and when the gorilla mux http handler that is the callee sets the status code as 4xx or 5xx along with some data in response body, the response in the caller is empty. However when the callee sets the status code as 2xx, the data in the response body is non empty in the caller.
To Reproduce
Create a service A which invokes a method in service B, write a http handler in service B using gorilla mux (I am creating the dapr service with mux like the docs explain) and set a status code of 4xx or 5xx along with some response data, the response data will be empty in the eyes of the caller.
Expected behavior
I expect that the response data is returned no matter the status code set in the callee.
The text was updated successfully, but these errors were encountered:
unnsteinngardars
changed the title
service invocation with gorilla mux http handler not returning body for status code > 200
service invocation with gorilla mux http handler not returning body for status code 4xx or 5xx
Feb 21, 2023
@unnsteinngardars Thanks for reporting this issue! Can you please try the latest dapr and SDK version? I haven't reproduced this using github.com/dapr/go-sdk v1.7.0 and the newest dapr version, so this issue may have been fixed.
@unnsteinngardars Thanks for reporting this issue! Can you please try the latest dapr and SDK version? I haven't reproduced this using github.com/dapr/go-sdk v1.7.0 and the newest dapr version, so this issue may have been fixed.
@Taction That does not seem to work. Are you not able to reproduce this? In my case, when I return a successful status code, the only thing that is returned from InvokeMethod is the response body, no status code, no headers, nothing else.
When I return an unsuccessful status code (400 for example) I get an empty response from InvokeMethod but the status code is reflected in the error returned by InvokeMethod like this (rpc error: code = Internal desc = Bad Request)
Is it not correctly assumed that I should receive the HTTP response including body, status code and headers?
Describe the bug
I have a service A and a service B. Service A is invoking a method in B. I can successfully invoke the method and when the gorilla mux http handler that is the callee sets the status code as 4xx or 5xx along with some data in response body, the response in the caller is empty. However when the callee sets the status code as 2xx, the data in the response body is non empty in the caller.
I have tried to directly invoke the method using GET http://localhost:3500/v1.0/invoke/app-id/method/method-name when setting the status code as 4xx or 5xx in the callee, and in that case the response data is returned correctly.
So this must be some bug in the go sdk.
To Reproduce
Create a service A which invokes a method in service B, write a http handler in service B using gorilla mux (I am creating the dapr service with mux like the docs explain) and set a status code of 4xx or 5xx along with some response data, the response data will be empty in the eyes of the caller.
Expected behavior
I expect that the response data is returned no matter the status code set in the callee.
The text was updated successfully, but these errors were encountered: