question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No way to specify CORS on resumable upload initiate session

See original GitHub issue

So I am sending consumers a session url to use as a point to do resumable uploads using the StorageClient.CreateObjectUploader() method

            var tempUploader = _client.CreateObjectUploader(myBucket, destination, properties.ContentType, new MemoryStream(), options);

            tempUploader.Body.Metadata = new Dictionary<string,string>()
            {
                { "foo", "bar" }
            };

            tempUploader.Body.ContentType = "some-content-type";

            tempUploader.Body.Size = 1337;

            var uploadUri = await tempUploader.InitiateSessionAsync();

I would like to add Origin : * or Origin : http://something.com headers to this InitiateSession request. how do I do that? using the package version 2.2.1, all help greatly appreciated 😃

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15

github_iconTop GitHub Comments

4reactions
jskeetcommented, Dec 5, 2018

Aha - it looks like we should be able to add this option after all, using the ResumableUploadOptions.ModifySessionInitiationRequest property. Will look into that further today.

1reaction
Lutandocommented, Dec 6, 2018

Preliminary Result - It works! but since we are doing chunked uploads we get the cors error on the last uploaded chunk request, but it still completes the resumable upload (despite the CORS error on resumable upload completion), I am under the impression that we might be doing something wrong on the client side.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google Storage API - Resumable Upload, AJAX, CORS Error
My server authenticates server-side with OAuth2 to Google's servers, creates an access token, begins a resumable upload, and passes the ...
Read more >
Resumable uploads | Cloud Storage
In both cases, you have to initiate a new resumable upload, obtain a new session URI, and start the upload from the beginning...
Read more >
Perform resumable uploads | Cloud Storage
Overview. This page describes how to make a resumable upload request in the Cloud Storage JSON and XML APIs. This protocol allows you...
Read more >
CORS Enabled - W3C Wiki
How can I participate? Granting JavaScript clients basic access to your resources simply requires adding one HTTP Response Header, namely: Access-Control-Allow- ...
Read more >
TUS resumable upload — plone.restapi 1.0a1 documentation
plone.restapi supports the TUS Open Protocol for resumable file uploads. ... documentation for more information on how to configure CORS policies.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found