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

The overridden Blob constructor process unnecessary data #1359

Closed
LavrovArtem opened this issue Nov 3, 2017 · 3 comments
Closed

The overridden Blob constructor process unnecessary data #1359

LavrovArtem opened this issue Nov 3, 2017 · 3 comments
Labels
AREA: client !IMPORTANT! STATE: Auto-locked Issues that were automatically locked by the Lock bot TYPE: bug
Milestone

Comments

@LavrovArtem
Copy link
Contributor

details

@LavrovArtem LavrovArtem added this to the Planned milestone Nov 3, 2017
@miherlosev miherlosev modified the milestones: Planned, Sprint #10 Nov 25, 2017
@miherlosev
Copy link
Contributor

miherlosev commented Nov 25, 2017

Simple example to reproduce:

<html>
	<body>
	    <p>Image file:</p>
		<input id="fileInput" type="file" />
		<div onclick="uploadFile()"><b>Upload</b></div>
		<p>Image:</p>
		<img />
		<script>
			function uploadFile() {
				var file = document.getElementById('fileInput').files[0];
				var fr   = new FileReader();

            fr.onload = function (args) {                
                var raw = window.atob(fr.result.replace('data:image/png;base64,', ''));
                var rawLength = raw.length;
                var uInt8Array = new Uint8Array(rawLength);
                for (var i = 0; i < rawLength; ++i) {
                    uInt8Array[i] = raw.charCodeAt(i);
                }
                var content = new Blob([uInt8Array]);
                //Now content contains data processed as script.
                // But if uInt8Array is a binary data (jpeg, png, etc) then we should not process it
            };
            fr.readAsDataURL(file);
        }
		</script>
	</body>
</html>

The problem blocks image upload testing in mobile XAF.

@miherlosev
Copy link
Contributor

I'm working on this

miherlosev pushed a commit to miherlosev/testcafe-hammerhead that referenced this issue Dec 19, 2017
AndreyBelym pushed a commit to AndreyBelym/testcafe-hammerhead that referenced this issue Feb 28, 2019
 DevExpress#1359) (DevExpress#1427)

* fix 'The overridden Blob constructor process unnecessary data' (close DevExpress#1359)

* fix tests
@lock
Copy link

lock bot commented Mar 28, 2019

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

@lock lock bot added the STATE: Auto-locked Issues that were automatically locked by the Lock bot label Mar 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
AREA: client !IMPORTANT! STATE: Auto-locked Issues that were automatically locked by the Lock bot TYPE: bug
Projects
None yet
Development

No branches or pull requests

2 participants