0

I have two inputs for set urls, first for image and second for some site

I must to load image and site in iframe

If user set url with scheme everything is ok, the problems spears when url does not contains the scheme 'http://' or 'https://'

how to add right scheme to url

make a request to 'http://' + my_url and check if the code if is 404 make another request to 'https://' + my_url

Alehandro
  • 19
  • 4

1 Answers1

0

I think this one can help you if you mean this what i think.

How can I catch a 404? if there's a 404 you run the same code with and without "https" it's on you on which one you start "requesting".

Community
  • 1
  • 1
Markus G.
  • 1,620
  • 2
  • 25
  • 49