Add CORS headers to JSONRPC response
- Dominant language
- C++
- Stars
- 397
- Forks
- 129
- PR merge metrics
- No merged PRs in 30d
Description
### What would you like to be added:
To access a locally running full wallet with a web-based application, it is necessary to return CORS (Cross-Origin Resource Sharing) headers from localhost.
See: https://enable-cors.org/
### Why is this needed:
That's essential to develop apps based on web components. The full node UI is running on Electron, which is basically a Chrome browser without UI. Looking into this application's source code, this flag is turned off:
`
webPreferences: {
webSecurity: false
}
`
Which is declared as not a good practice, but acceptable when not loading data from any public source.
It should not be problematic to return these headers by default or by parameter flag, at least from my current perspective. If there's any concern about that, please let me know!
When returning these headers, the full node UI should be okay to turn that webSecurity flag back to true.
And there are circumstances when developers want to access the full node as well, but also want to gather data from other sources than just the full node. In this case, I'd love to be able to enable that webSecurity flag as well. Then I'd be able to use the Jellyfish SDK in my electron application instead of writing my own integration with fake CORS headers.
Contributor guide
Research direction
The issue identifies JSONRPC responses and the full-node UI but names no source file or test. Start by locating the JSONRPC response entry point and any existing CORS or security handling; done means localhost web clients receive the required headers and the behavior is verified by the relevant test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, electron
- Domain
- api, backend, security
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100