Skip to content
This repository has been archived by the owner on Feb 25, 2023. It is now read-only.

Strip request origin #710

Merged

Conversation

toasted-nutbread
Copy link
Collaborator

Fixes #706.

This change adds the webRequest and webRequestBlocking permissions, as they are needed to modify the headers. However, according to some docs, these additional permissions should not trigger an additional permissions warning, since I believe they fall under the same category as <all_urls>.

The new function fetchAnonymous is added in this change, which strips the Cookie header and modifies the Origin header to match the origin of the URL that is being requested. AudioUriBuilder and AudioSystem currently use this. The XMLHttpRequest changes made in #708 have been reverted to fetch.

(Note that there is an extremely unlikely chance for the header modification to affect an external request, but this would require an incredibly unlikely timing exploit that also requires user input, and would ultimately not really be harmful.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Japanesepod101 Audio and Custom audio source (URL)
1 participant