cors-anywhere icon indicating copy to clipboard operation
cors-anywhere copied to clipboard

The URL is invalid: two slashes are needed after the http(s):.

Open ChickenDipper1 opened this issue 2 years ago • 6 comments

Hello,

I have managed to get cors-anywhere setup on my plesk server :) But I seem to be running into an issue I cannot figure out, no matter what URL I use I am presented with the error: " The URL is invalid: two slashes are needed after the http(s):. "

This error shows no matter what URL I try to access for example:

https://mycorsproxy.url/http://google.com https://mycorsproxy.url/https://google.com

Am I missing something obvious here? Any help is much appreciated, thank you!

ChickenDipper1 avatar Apr 07 '22 10:04 ChickenDipper1

Same issue! I´m using Azure Cloud

FelipeGerolomo avatar Apr 07 '22 23:04 FelipeGerolomo

You have something else running in front of CORS Anywhere that normalizes the URLs. You should disable that URL rewriting mechanism, to preserve the original request URL. If that is not possible at all, an alternative is to omit the scheme.

From a quick search, it seems that Plesk uses Apache. See https://github.com/Rob--W/cors-anywhere/issues/308

For Azure Cloud, see #82.

Rob--W avatar Apr 10 '22 16:04 Rob--W

Thank you for pointing me in the right direction, turning off nginx proxy mode under nginx settings solves the issue in Plesk.

ChickenDipper1 avatar Apr 10 '22 17:04 ChickenDipper1

Cloudflare Workers W3C URL JS class has a well known bug that turns "//" into "/" . The CF bug can be googled.

bulk88 avatar Mar 14 '23 21:03 bulk88

please guide vercel also

rishi-gurung avatar Apr 01 '23 05:04 rishi-gurung

If this is useful for someone

Here is a config for nginx

  1. start your cors-anywhere at localhost:4200
  2. Add this config to the nginx
  merge_slashes off;
  location / {
      proxy_pass          http://localhost:4200/;
  }

Its-Just-Nans avatar May 06 '23 14:05 Its-Just-Nans