<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Empty Content-Type header sent when uploading a file using XMLHttpRequest and type-less Blob"
href="https://bugs.webkit.org/show_bug.cgi?id=159210">159210</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Empty Content-Type header sent when uploading a file using XMLHttpRequest and type-less Blob
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>Product</th>
<td>WebKit
</td>
</tr>
<tr>
<th>Version</th>
<td>Safari 9
</td>
</tr>
<tr>
<th>Hardware</th>
<td>iOS
</td>
</tr>
<tr>
<th>OS</th>
<td>OS X 10.11
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>Normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P2
</td>
</tr>
<tr>
<th>Component</th>
<td>XML
</td>
</tr>
<tr>
<th>Assignee</th>
<td>webkit-unassigned@lists.webkit.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>Russiandevil@gmail.com
</td>
</tr></table>
<p>
<div>
<pre>In my Javascript application I upload files to Amazon S3 bucket using XMLHttpRequests using type-less blobs
e.g. var myTypeLessBlob = new window.Blob([some Uint8Array of data]).
The reason I'm not specifying a Content-Type (instead of using, say, application/octet-stream or binary/octet-stream,
which is what this data is technically) is because I need to support a legacy (cannot modify the code of) version of
Java application which fetches these uploaded documents later, and S3 expects the Content-Type header value that was
specified during upload to be the same during download later - and the legacy app doesn't specify Content-Type during
its uploads or downloads.
Anywho, this type-less blob approach for upload and subsequent download seems to work fine for me in Chrome, Firefox, IE11,
Microsoft Edge. That is, the Content-Type header does not get sent in a PUT request to the server and later on when I download
the document it's the Amazon S3 that tells me that its in fact binary/octet-stream in its response header.
However when using Safari, I noticed that for some reason the Content-Type header gets sent as an empty string
during upload - which results in the same behaviour during the subsequent download, which causes issues when I
try to download my Safari-uploaded file in those other browsers.
Is there some reason Safari/Webkit is behaving differently to other browsers in this regard?
cheers,
Greg</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>