Allow other browser clients to request using all available method (e.g. POST / PUT)
- Dominant language
- Python
- Stars
- 26
- Forks
- 21
- Avg merge
- 4d 23h
- Merged PRs (30d)
- 15
Description
Our team at CatalystNeuro has started working on the [NWB GUIDE](https://github.com/NeurodataWithoutBorders/nwb-guide) to automate data conversions to the Neurodata without Borders standard as well as final uploads to the DANDI Archive.
Alongside some work on WebNWB, we have started building a [custom TypeScript implementation](https://github.com/brainsatplay/webnwb/tree/main/packages/dandi) of the DANDI REST API with the intention of [creating dandisets from the GUIDE](https://github.com/NeurodataWithoutBorders/nwb-guide/issues/221)—and recently hit a snag because of the limited read-only access that unregistered origins have and the resulting CORS issue that is generated (#256).
## Current Behavior
> **Note:** All of these behaviors were noted while hosting a development server on http://127.0.0.1:5173/.
For dandiset creation, I was able to actually create a dandiset on the staging site _despite a CORS error_ that errored my request (which returned a 200 code), a behavior that I found quite perplexing.
On the other hand, I tried renaming an asset on the main instance and was unable to edit the metadata because of an `ERR_FAILED 301 (Moved Permanently)` error (possibly pointing at other issues, though I ran a cURL request with the same information and was successful).
## What We Need
While this custom implementation has been useful for, for instance, displaying all available dandisets on the [main WebNWB demo](https://brainsatplay.com/webnwb/), its utility begins to break down with the above constraints.
Has there been any further deliberation about removing the CORS restrictions since #256, or are we the only users requesting this feature? With reference to both the GUIDE and WebNWB, I would love to be able to have other browser clients submit requests to the DANDI REST API—though I also understand this may be out of scope.
An alternative solution on our end would be to simply [bypass CORS](https://pratikpc.medium.com/bypassing-cors-with-electron-ab7eaf331605) on the GUIDE Electron application. This, however, is more of a hack than a solution.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading issue #256 and the repository's current CORS behavior, then reproduce the reported requests from http://127.0.0.1:5173/ using the WebNWB TypeScript client or GUIDE context. Done means the agreed browser clients can submit the required methods, including POST and PUT, without the reported CORS or redirect failures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- api, backend, security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100