Skip to content

LargeFileUploadTask cors error #220

Description

@gunnim

Description

When attempting a LargeFileUploadTask it errors on client PUT with
Access to fetch at '<< longurlremoved >>' from origin 'http://localhost:3000' has been blocked by CORS policy: Request header field sdkversion is not allowed by Access-Control-Allow-Headers in preflight response.

Steps to Reproduce

  1. Follow the steps here https://github.com/microsoftgraph/msgraph-sdk-javascript/blob/dev/docs/tasks/LargeFileUploadTask.md

Additional Context

If i store the session url, fileslice and headers then manually PUT using fetch not the client, that works.
So the session url does not require authorization, maybe it should not use the client?

Usage Information

I'm running 1.7.0 but the problematic code has not changed in the lated preview.

  • Node (Check, if using Node version of SDK)

Node Version - [The version of Node you are using]

  • [x ] Browser (Check, if using Browser version of SDK)

Browser Name - [The name of Browser that you are using for SDK]
Chrome
Version - [The version of the browser you are using]
76

Activity

  1. krototype commented on Sep 17, 2019

    @krototype
    Contributor

    Try to use the latest version and see if this issue still persists.

  2. krototype commented on Sep 25, 2019

    @krototype
    Contributor

    As there seems to be no response, so closing the issue, for now, feel free to reopen the issue if needed.

  3. malinkody commented on Jan 28, 2020

    @malinkody

    I'm having the exact same issue on the latest version 2.0.0. Only seems to happen for personal accounts trying to use LargeFileUploadTask for upload to onedrive.

    Access to fetch at 'https://api.onedrive.com/rup/24b5d554d8c0d12a/<longurlpartremoved>' from origin 'http://localhost:8081' has been blocked by CORS policy: Request header field sdkversion is not allowed by Access-Control-Allow-Headers in preflight response.

    Other requests like GET /drives/<drive-id>/items/children work perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions