Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to embed CORS proxy URL in "fetch" relay_url #1188

Closed
chschnell opened this issue Nov 27, 2024 · 1 comment
Closed

Allow to embed CORS proxy URL in "fetch" relay_url #1188

chschnell opened this issue Nov 27, 2024 · 1 comment

Comments

@chschnell
Copy link
Contributor

chschnell commented Nov 27, 2024

v86/src/browser/starter.js

Lines 314 to 317 in 298da23

if(relay_url === "fetch")
{
this.network_adapter = new FetchNetworkAdapter(this.bus);
}

My suggestion would be to change this to:

if(relay_url.startsWith("fetch")) {
    const fetch_options = {};
    if(relay_url.length > 6 && relay_url[5] === ":") {
        fetch_options.cors_proxy = relay_url.slice(6);
    }
    this.network_adapter = new FetchNetworkAdapter(this.bus, fetch_options);
}

Things would behave as before when passing only fetch to config.net_device.relay_url, but when passing something like:

fetch:https://example.com/?url=

then CORS proxy https://example.com/?url= would be used.

@chschnell chschnell changed the title Allow to embedd CORS proxy URL in "fetch" relay_url Allow to embed CORS proxy URL in "fetch" relay_url Nov 27, 2024
@copy
Copy link
Owner

copy commented Dec 11, 2024

Cheers!

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

No branches or pull requests

2 participants