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

Potential body data loss for json GET requests #99

Closed
ufna opened this issue Mar 20, 2017 · 2 comments
Closed

Potential body data loss for json GET requests #99

ufna opened this issue Mar 20, 2017 · 2 comments
Labels
bug Something isn't working research
Projects

Comments

@ufna
Copy link
Owner

ufna commented Mar 20, 2017

Support request from dmaxime

the user sent me a POST request with a json string as data and I received a package like this (just an example):

----------------------------------------------------------------------------------------
POST http://xxxxxxxxxxxxxxx.com/login HTTP/1.1
Accept: application/json
Content-Type: application/json; charset=utf-8
User-Agent: xxxxxxxxxxxxxxx/0.1
Host: xxxxxxxxxxxxxxxs.com
Content-Length: 50
Expect: 100-continue

{"login":"xxxxxx@mail.com","password":"123456789"}
----------------------------------------------------------------------------------------

At this point the user decided that the parameter was not so important and he wanted to transform the POST request to GET and probably was the only thing he changed in blueprint node. So I received this package:

----------------------------------------------------------------------------------------
GET http://xxxxxxxxxxxxxxx.com/login HTTP/1.1
Accept: application/json
Content-Type: application/json; charset=utf-8
User-Agent: xxxxxxxxxxxxxxx/0.1
Host: xxxxxxxxxxxxxxxs.com
Content-Length: 50
Expect: 100-continue


----------------------------------------------------------------------------------------

Where, as you can see, the request changed from POST to GET and the parameter (the json string) disappeared. Unfortunately, the Content-Length parameter remained unchanged, so, my server, waited for data that did not arrive because probably truncated.
For this reason, I thought that when the user gives some data to your node you put their length in parameter Content-Length and after, if you see that the chosen method is GET, you cut the parameter but forget to remove also the parameter Content-Length.
@ufna ufna added the research label Mar 20, 2017
@ufna
Copy link
Owner Author

ufna commented Mar 20, 2017

I've checked my code, it seemed to be issue of the FHttpRequest itself.

@saidmoya12
Copy link

Could be a problem with responseContent is FString
https://answers.unrealengine.com/questions/303596/text-vs-string-variable.html

FText is hardest to use but could be required for the response body

@ufna ufna added the bug Something isn't working label Oct 5, 2019
@ufna ufna added this to Backlog in Development Oct 5, 2019
@ufna ufna closed this as completed in acbad67 Aug 26, 2021
Development automation moved this from Backlog to Done Aug 26, 2021
ufna added a commit that referenced this issue Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working research
Projects
Development
  
Done
Development

No branches or pull requests

2 participants