1.2 KiB
Limitations From The Browser Environment: CORS Issue
The plugin is developed for the browser environment. The "fake" browser behind the scenes also follows CORS policy.
To solve the issue, we have some options:
-
The server side needs to return the header
Access-Control-Allow-Origin
allowing the originsapp://obsidian.md
andcapacitor://localhost
andhttp://localhost
. Sometimes in the future, the headerAccess-Control-Expose-Headers
with some values being set might be also needed.Here is an example configuration for Amazon S3.
However, some cloud services do not allow configuring or exposing these headers. (Notably most public WebDAV services.)
It's of course possible if the users build the services by themselves.
-
Obsidian implements and exposes a new api helping developers to bypass the CORS policy.
Currently (as of Feb 2022), an api
request()
indeed exists, but it only deals with text-like data, and does not support binary data or response headers reading yet.Because this plugin allows uploading and downloading binary data, so a more feature-rich api is needed.