Tus-java-client. Server returned HTTP response code: 400

I’m getting this error when try to upload a video to Cloudflare servers:
unexpected status code (400) while uploading chunk

The root cause is:
java.io.IOException: Server returned HTTP response code: 400

It seems that the root cause is following code, at TusUploader.java file, we have:

        try {
            // Check whether we are running on a buggy JRE
        } catch (java.net.ProtocolException pe) {
            connection.setRequestProperty("X-HTTP-Method-Override", "PATCH");

The client code is the sample at https://github.com/tus/tus-java-client.

I have found a similar issue at:

Cloudflare does not support the X-HTTP-Method-Override header.

Are Cloudflare going to support this header, or is there any workaround does not depends on server configuration?

Cloudflare is recommending using the lib tus-java-client, but it does not work fine. Any other implementation in java?


1 Like

@mcprol , did you find an elegant way to work around this?

I have implemented the workaround only for java 11. You can see my conversation at: https://github.com/tus/tus-java-client/issues/66#issuecomment-1280052624

1 Like