Greenguy's Board


Go Back   Greenguy's Board > General Business Knowledge
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2018-02-10, 11:10 AM   #1
Mud
Internet! Is that thing still around?
 
Join Date: Dec 2017
Location: Amsterdam
Posts: 3
Send a message via ICQ to Mud
Those are called protocol-relative urls. They will automatically load either from http or https depending if you use the secure version of the website or not.

If you put a http image on a https page you will get a security warning and the image wont load.
Mud is offline   Reply With Quote
Old 2018-02-10, 11:49 AM   #2
Greenguy
The Original Greenguy (Est'd 1996) & AVN HOF Member - I Crop Pics For Thumbs In My Sleep
 
Greenguy's Avatar
 
Join Date: Feb 2003
Location: Blasdell, NY (shithole suburb south of Buffalo)
Posts: 41,929
Send a message via ICQ to Greenguy
Quote:
Originally Posted by Mud View Post
If you put a http image on a https page you will get a security warning and the image wont load.
So is that a workaround where you can load an image from a non-secure URL onto a secure page?
__________________

Promote POV Porn Cash By Building & Submitting Galleries to the Porn Luv Network
Greenguy is offline   Reply With Quote
Old 2018-02-10, 03:28 PM   #3
sarettah
Asleep at the switch? I wasn't asleep, I was drunk
 
Join Date: Apr 2005
Posts: 214
They are scheme relative urls.

https://stackoverflow.com/questions/...-relative-urls

Quote:
Scheme relative URLs (network-path references) are something that I've just found out about - where you don't specify the scheme of a URL and it picks it up from the current context.

For example: <img src="//domain.com/img.png" /> will resolve to https://domain.com/img.png if the current scheme is HTTPS or http://domain.com/img.png if it is not.

This seems like a very easy way to resolve those pesky problems of calling an external script or image on an SSL page without bringing up the dreaded error that some content on a page is not secure.

The benefit seems obvious, but what I don't seem to be able to find is a huge amount of information on this and was wondering if anyone had any experience or references about scheme relative URLs (good or bad)?


This article references an article from 2010 telling people to use scheme ralative but was updated in 2016 to tell you why it is bad to use them:

https://jeremywagner.me/blog/stop-us...-relative-url/

Quote:
Paul Irish has since changed his stance, and now advises against using this URL scheme to reference cross-origin resources. His rationale is that while using the scheme on HTTPS pages is safe, the reverse is not true. Using the scheme on a non-secure page will retrieve cross-origin assets in a non-secure fashion. This isn't good, and it's rather easy to just slap an https:// protocol on your URLs to ensure that your site is completely secure.

.
sarettah is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:44 AM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc