If a RestContext::PUT call is made with a body data string and the webserver responds with OK 200 but empty response body the callback seems to be re-using the PUT data buffer instead and it appears like the webserver echoed the original request - even though that is not the case. I guess after sending the PUT the buffer must be cleared even if the response is empty?
Description
Details
- Severity
- Minor
- Resolution
- Open
- Reproducibility
- Always
- Operating System
- Windows 10 x64
- Category
- General
Event Timeline
Hello Arkensor.
This info comes from the responsible developer:
- it's actually status messsage because data are not present
- however it does not make sense anyway - so status will be not returned in such case (to not be considered as data by anyone), but empty string instead
Also if possible, please attach logs and data in the future tickets as it makes harder for the devs to assume what you are trying to describe
Hello,
I am sorry if my bug report was not clear enough. I thought I had given all the required info to reproduce. I make so many tickets here each week that sometimes I don't have time to provide a full reproduction. However here it is ready to copy paste
class TestWebCallback : RestCallback { static ref set<ref TestWebCallback> s_aSelfReferences = new set<ref TestWebCallback>(); static TestWebCallback PostToUrl(string url, string data) { TestWebCallback callback(); s_aSelfReferences.Insert(callback); RestContext context = GetGame().GetRestApi().GetContext(url); context.POST(callback, "", data); return callback; } override void OnError(int errorCode) { s_aSelfReferences.RemoveItem(this); Print(" !!! OnError() "); }; override void OnTimeout() { s_aSelfReferences.RemoveItem(this); Print(" !!! OnTimeout() "); }; override void OnSuccess(string data, int dataSize) { s_aSelfReferences.RemoveItem(this); Print(" !!! OnSuccess() size=" + dataSize ); if (dataSize > 0) Print(data); }; }; TestWebCallback.PostToUrl("https://webhook.site/640403f4-c83e-4977-aac7-ef863a6c69da", "I like Arma!!!");
SCRIPT : !!! OnSuccess() size=14
SCRIPT : string data = 'I like Arma!!!'
While the website is configured to return NOTHING. You can check by opening the link direclty.
Sanity checking with postman shows that webhook.site does not echo by default or anything. Just empty response body. And that triggers the problem, both with POST and PUT and maybe anything that sends a request body?
Apologies from the dev, I was given a wrong ticket, the original response was supposed to go to https://feedback.bistudio.com/T166390
Hello Arkensor.
The problem has been addressed internally and the fix will appear in one of the future updates.