Last active
April 2, 2016 02:56
-
-
Save nolanlawson/2d6cdd75df91b04c49706e9abe2222a7 to your computer and use it in GitHub Desktop.
Repro blob with query params bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<h1>Repro blob with query params bug</h1> | |
<p>If you see <strong>404</strong> below, then the bug is present.</p> | |
<pre id="display"></pre> | |
<script> | |
(function () { | |
var display = document.getElementById('display'); | |
var blob = new Blob(['hello'], {type: 'text/plain'}); | |
var url = URL.createObjectURL(blob) + '?q=x'; | |
var xhr = new XMLHttpRequest(); | |
xhr.onload = function () { | |
var body = xhr.response; | |
display.innerHTML += 'url: ' + url + | |
'\nstatus: ' + xhr.status + | |
'\ntype: ' + body.type + | |
'\nsize: ' + body.size; | |
}; | |
xhr.responseType = 'blob'; | |
xhr.open('GET', url); | |
xhr.send(); | |
})(); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment