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

[Bug] Handling of Binary Data as String in AbstractMockRequest Leads to Data Corruption #795

Open
sumsar1812 opened this issue Jan 31, 2024 · 3 comments

Comments

@sumsar1812
Copy link

When sending binary data (e.g., files with .lzma extension) via POST requests to SoapUI, the handling of the request in AbstractMockRequest (specifically at this line)) ) converts the incoming binary data into a String.

This approach is problematic for binary data, as the conversion process corrupts the data. This issue is evident when trying to save the received data to a file. The problem persists even when using getRawRequestData(), which, instead of returning the original byte array of the request, returns the byte array of the string representation, leading to further corruption.

A potential solution could be to modify the handling in AbstractMockRequest to avoid converting binary data into a String. Instead, it could directly work with the byte array. One approach might be to introduce a new field from around line 151 and utilize this field in getRawRequestData() to return the original binary data.

@IvanovIlya116
Copy link

Hello. I need opened pull request for me.

@IvanovIlya116
Copy link

#806

@IvanovIlya116
Copy link

To rewrite the code to return a byte array method, you will have to rewrite most of the SoapUI core and test its functionality. I may not have studied the code well, but the method definitely expects an xml file, so I added the encoding detection and subsequent conversion to UTF-8 to the code, since there may be files with a different encoding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants