Skip to content

Instantly share code, notes, and snippets.

@nolanlawson
Last active April 2, 2016 02:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nolanlawson/2d6cdd75df91b04c49706e9abe2222a7 to your computer and use it in GitHub Desktop.
Save nolanlawson/2d6cdd75df91b04c49706e9abe2222a7 to your computer and use it in GitHub Desktop.
Repro blob with query params bug
<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