Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TUS DELETE request fails with Cloudflare Stream #5629

Open
2 tasks done
aerni opened this issue Jan 28, 2025 · 0 comments
Open
2 tasks done

TUS DELETE request fails with Cloudflare Stream #5629

aerni opened this issue Jan 28, 2025 · 0 comments
Labels

Comments

@aerni
Copy link

aerni commented Jan 28, 2025

Initial checklist

  • I understand this is a bug report and questions should be posted in the Community Forum
  • I searched issues and couldn’t find anything (or linked relevant results below)

Link to runnable example

No response

Steps to reproduce

I'm using Uppy Dashboard with TUS to upload videos to Cloudflare Stream. I've got the upload and resumability working as expected. But I'm running into issues when cancelling the download using the X button in the Dashboard UI. I've been researching for hours and came across a Cloudflare forum post mentioning, that Cloudflare Stream doesn't support the TUS termination extension. So it makes sense, that I'm running into these exceptions:

Image

According to Cloudflare, I'm supposed to send a DELETE request to the regular API endpoint. Now I'm wondering how I might implement this with Uppy? Is there a way to override the endpoint URL that is used when the TUS upload is aborted? I found this issue that made me wonder if I could maybe override the URL in the onBeforeRequest. I was able to set the URL but the request to Cloudflare still uses the initial endpoint URL.

uppy.use(Tus, {
    endpoint: "https://initial-endpoint.com",
    onBeforeRequest: function (req) {
        if (req.getMethod() === 'DELETE') {
            req._url = "https://delete-endpoint.com";
        }
    },
});

I opened an issue because I believe this to be an important feature, as quite some people are using Cloudflare Stream. I also found this issue that initially talked about implementing the termination extension.

Expected behavior

The DELETE request shouldn't fail. But in the case of Cloudflare Stream, there needs to be a way to pass a different endpoint for DELETE requests.

Actual behavior

The DELETE requests fail as per bug description.

@aerni aerni added the Bug label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant