Closed leoncarl closed 4 years ago
@leoncarl Which nakama-cpp version do you use? This issue has been patched in 2.2.0 version and later properly fixed in master branch and not released yet. So, please try 2.2.0 version.
Proper fix is here https://github.com/heroiclabs/nakama-cpp/commit/8fcaa597b037032f3cfc4b75e82881ecbb612ad9
Yeah, we are on 2.1.0
currently. For now we've just patched 2.1.0
. We will likely update to the next version > 2.2.0
when it is released. Cheers.
I'm experiencing an issue with the nakama-cpp lib talking to nakama in a docker container. It is sending a Content-Type: text/plain; charset=utf-8, application/json header (which is not valid AFAIK). I get back an golang mime type error.
I suspect this has always been an issue but only errors with 2.7 / golang 1.3.x (have not confirmed this). One annoyance is that the error never hit the nakama logs so for a while I was suspecting docker networking barfing on it before forwarding to the container. It was only after I realized that gRPC code 3 was being returned that I knew it was reaching Nakama but not error logging.
With nakama 2.5.1 container (does not error)
With nakama 2.7.0 container (does error)
I suspect the issue is with
cpprestsdk
you use not being very smart/careful about which headers are actually allowed to have multiple of (as a comma separated list of values: https://github.com/heroiclabs/nakama-cpp/blob/master/third_party/cpprestsdk/Release/include/cpprest/http_headers.h#L172-L191 ) Sincerequest.set_body()
is called with no secondcontent-type
property https://github.com/heroiclabs/nakama-cpp/blob/v2.1.0/src/NHttpClientCppRest.cpp#L89-L95 the default oftext/plain; charset=utf-8
is being used: https://github.com/heroiclabs/nakama-cpp/blob/master/third_party/cpprestsdk/Release/include/cpprest/http_msg.h#L677-L704 However, you are then adding more headers, including aContent-Type: application/json
one https://github.com/heroiclabs/nakama-cpp/blob/v2.1.0/src/NHttpClientCppRest.cpp#L94 that was set earlier: https://github.com/heroiclabs/nakama-cpp/blob/v2.1.0/src/RestClient.cpp#L159