-
Notifications
You must be signed in to change notification settings - Fork 220
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
Request header field SdkVersion is not allowed by Access-Control-Allow-Headers in preflight response #109
Comments
@jasontianxie From where you are making your request ? is your Origin and Referer request headers are set ? |
i make the reqest in web client side ,it is like this: this.onedrive.api('/me/drive/items/' + params.id + '/content').get().then..... the request headers are : Accept:/ |
@jasontianxie
|
@muthurathinam 1、Response headers for this get() request. Request URL:https://graph.microsoft.com/v1.0/me/drive/items/..../content Response headers: Access-Control-Allow-Origin:* 2、redirect request headers :authority:public.ch.files.1drv.com 3、redirect response headers access-control-allow-headers:Accept, Application, Authorization, Content-Range, Content-Type, If-Match, If-None-Match, Overwrite, Prefer, Range, X-HTTP-Method-Override, X-RequestStats, X-TransactionId, X-Upload-Content-Length, MS-CV, RequestFacts 4、console error: |
Hello, I have the same issue ! Do we have an ETA on that ? Thanks, |
Downloading content from OneDriveHello @jasontianxie @J3remyD, To download files from OneDrive in a JavaScript app you cannot use the Instead, your app needs to select the ExampleTo retrieve the download URL for a file, first make a request that includes the client.api(`/me/drive/items/${itemId}`)
.get()
.then((response) => {
downloadURL = response["@microsoft.graph.downloadUrl"];
window.location.href = downloadURL;
}); |
Helli @muthurathinam, thank you very muche man, it works like a charm !!! :) |
@muthurathinam thanks |
Closing this thread. |
hi,
when i send a request to download a file :GET /me/drive/items/{item-id}/content
it will get an error :Request header field SdkVersion is not allowed by Access-Control-Allow-Headers in preflight response.
in request header:
SdkVersion:graph-js-1.2.0
The text was updated successfully, but these errors were encountered: