CORS error on attachment upload

Operation system: Linux Ubuntu

Web Browser: Chrome


Bug report

What were you doing: Adding a pdf document to a note

What feature did you use: Drag and drop

What happened: The document is not synced and an error is shown
image

What did you expect to happen: The document shall be uploaded


Feedback: I see many CORS related errors in console. The error only happens with attachments (i also tried png, and jpeg), but text modifications to the note syncs fine.

/#/notes/note/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX:1 Access to fetch at 'https://cws.icloud-content.com/REDACTED/singleFileUpload?tk=REDACTED&ref=REDACTED&c=iCloud.net.shinyfrog.bear&z=Notes&uuid=REDACTED&dataclass=com.apple.Dataclass.CloudKit&p=120&e=REDACTED' from origin 'https://web.bear.app' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Hi, thanks for the feedback. Yes, we noticed this last night and are actively working on it. It looks like something changed in the way Apple manages CORS permissions, resulting in failed uploads from Bear Web. I’m testing now a workaround, we’ll keep you posted.

1 Like

Ok, we deployed a fix. As usual, let us know if you notice anything unusual!

2 Likes

Thanks! Just tried before leaving office and everything looks fine!

Tomorrow I’ll use it a bit more and let you know if I notice anything strange.

Hi Bear team,

I’m building a web app that syncs with CloudKit via CloudKit JS (2.6.4), and I’m running into exactly the issue from this thread: reading records and downloading assets works, but saving a record with an asset fails because the preflight to https://cws.icloud-content.com//singleFileUpload?tk=… comes back without an Access-Control-Allow-Origin header. As far as I can tell, the upload host only allows https://www.icloud.com as an origin now, regardless of the origins registered on the API token.

You mentioned you shipped a fix the same day. Would you be willing to share roughly what you changed?

Thank You,

Steffen