-
Notifications
You must be signed in to change notification settings - Fork 310
Remove CORS restriction #46
Comments
added in v1.2.1 |
@ketankr9 simpletorrent has an undocumented API that can add magnet to the server too: other APIs are lately documented here: https://github.com/boypt/simple-torrent/wiki/RestfulAPI |
Now the browser-extension is able to read response from the simple-torrent server successfully, but only when auth is disabled. This is the security imposed by the browser, but the server side change can allow browsers to execute requests with Authorization header. https://github.com/ketankr9/cloud-torrent-extension/tree/auth |
Simple Torrent added a pure REST API endpoint that do not follow the authorization, it's intended to communicate with other programs. I think it suits your usage scenario. See the --rest-api argument |
Now cross-site xhr-requests can work inside browser(by scripts or extensions) even if the authentication is enabled. Tested on an extension which uses /api/ endpoint with authentication feature and solves [https://github.com/ketankr9/cloud-torrent-extension/issues/1#issuecomment-570915569](https://github.com/ketankr9/cloud-torrent-extension/issues/1#issuecomment-570915569)
Now cross-site xhr-requests can work inside browser(by scripts or extensions) even if the authentication is enabled. Tested on an extension which uses /api/ endpoint with authentication feature and solves [https://github.com/ketankr9/cloud-torrent-extension/issues/1#issuecomment-570915569](https://github.com/ketankr9/cloud-torrent-extension/issues/1#issuecomment-570915569) Note: CORS only affects webHandle
Now cross-site xhr-requests can work inside browser(by scripts or extensions) even if the authentication is enabled. Tested on an extension which uses /api/ endpoint with authentication feature and solves [https://github.com/ketankr9/cloud-torrent-extension/issues/1#issuecomment-570915569](https://github.com/ketankr9/cloud-torrent-extension/issues/1#issuecomment-570915569) Note: CORS only affects webHandle Co-authored-by: Preston <1033514+boypt@users.noreply.github.com>
Please allow cross site access. Especially to
/api/
calls, or else browser based applications like browser-extensions can't work.This can be achieved by editing
server_http.go
as demonstrated below.This will also solve the issue that I am having of not being able to read response using a browser-extension from remote simple-torrent server. ketankr9/cloud-torrent-extension#1 (comment)
The text was updated successfully, but these errors were encountered: