Skip to content

Commit a9e5841

Browse files
committed
Add Content-Type header to PATCH requests
1 parent 70f1328 commit a9e5841

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

src/main/java/io/tus/java/client/TusUploader.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public TusUploader(TusClient client, URL uploadURL, InputStream input, long offs
4949
connection = (HttpURLConnection) uploadURL.openConnection();
5050
client.prepareConnection(connection);
5151
connection.setRequestProperty("Upload-Offset", Long.toString(offset));
52+
connection.setRequestProperty("Content-Type", "application/offset+octet-stream");
5253
try {
5354
connection.setRequestMethod("PATCH");
5455
// Check whether we are running on a buggy JRE

src/test/java/io/tus/java/client/TestTusUploader.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public void testTusUploader() throws IOException, ProtocolException {
4141
.withPath("/files/foo")
4242
.withHeader("Tus-Resumable", TusClient.TUS_VERSION)
4343
.withHeader("Upload-Offset", "3")
44+
.withHeader("Content-Type", "application/offset+octet-stream")
4445
.withBody(Arrays.copyOfRange(content, 3, 11)))
4546
.respond(new HttpResponse()
4647
.withStatusCode(204)

0 commit comments

Comments
 (0)