feat: update cors headers for cross domain request - #33898
Conversation
|
Can you please clarify how these configuration changes fixed the problem? Is it the case that for files under the 100MB threshold no chunking is required, and therefore the offending headers (relative to CORS) are never used? But that chunking occurs with files bigger than this, that the headers are then introduced, and that CORS then blocks the operation? |
Correct, files under 100MB do not require chunking because they are within the accepted file size range. However, when a file >= 100MB is submitted a 413 error is thrown. When no chunking is required, no additional headers are required on the request. However, the chunking requires the additional headers for the backend to know how to stitch the chunks back together. As a result, the additional CORS headers need to be added or the API will always fail with a CORS error. It should be noted, that regardless of file size all files will go through the chunking process when importing in the course authoring mfe. |
|
Per our slack huddle, where we observed this PRs changes importing a 2GB file on hosted devstack, import looked to be in 1.2 kByte chunks, each taking a few seconds. A back-of-the-envelope calculation suggests that on the order of one million chunks would be required to get to a 2GByte file. A 10 minute delay would be 600 seconds, or maybe 200 chunks. This suggests that the solution we observed would not complete in anything near an acceptable timeframe. |
bszabo
left a comment
There was a problem hiding this comment.
Based on feedback that upload of 2 GB file took 2 minuts, lgtm
|
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
|
2U Release Notice: This PR has been deployed to the edX production environment. |
1 similar comment
|
2U Release Notice: This PR has been deployed to the edX production environment. |
|
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
|
2U Release Notice: This PR has been deployed to the edX production environment. |
Description
The import page chunks the uploaded file and uses the network headers
content-rangeandcontent-dispositionto send the chunk to the backend. These headers are not part of the default cors headers. This change impacts Authors.Supporting information
JIRA Ticket: TNL-11163
Testing instructions
Testing
Deadline
None
Other information
frontend-app-course-authoringPR #734 is dependent on this change.