-
Notifications
You must be signed in to change notification settings - Fork 217
Closed
Labels
area: framework ⚙Changes in the SDK core framework codeChanges in the SDK core framework codebugSomething isn't workingSomething isn't working
Description
Category
- Bug
Describe the bug
When calling GetContentAsync() on an IFile object from a Blazor project, an error is thrown:
"Access to fetch at 'https://<tenant>.sharepoint.com/sites/DevSite/_vti_bin/client.svc' from origin 'https://localhost: <port>' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request.'
Note: setting the IFile object and accessing its properties works as expected.
Steps to reproduce
- See attached code file
- Update the relative path on line 28 to a valid path
- Run the app and verify that @file.Name is displayed
- Uncomment line 31
- Verify that a CORS error is thrown
Expected behavior
I expect the contents of the file to be loaded to a stream.
Environment details (development & target environment)
- SDK version: 1.5.22-nightly
- OS: Windows 10 x64
- SDK used in: Blazor WebAssembly
- Framework: .NET 6
- Browser(s): Edge v97.0.1072.69
- Tooling: Visual Studio 2022
- Additional details: none
Additional context
Sorry, none.
GetContextAsync.razor.txt
Metadata
Metadata
Assignees
Labels
area: framework ⚙Changes in the SDK core framework codeChanges in the SDK core framework codebugSomething isn't workingSomething isn't working