This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new f53638d3 Handle protocol-relative links
f53638d3 is described below
commit f53638d3253e49e4c5d711dafe53d2ef3afaa1f1
Author: Sebb <[email protected]>
AuthorDate: Sat Nov 22 12:56:28 2025 +0000
Handle protocol-relative links
---
tools/site-scan.rb | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/site-scan.rb b/tools/site-scan.rb
index 8a633c25..7701f7f5 100755
--- a/tools/site-scan.rb
+++ b/tools/site-scan.rb
@@ -185,7 +185,12 @@ def parse(id, site, name, podling=false)
if %w(http https).include? scheme # no need to rebase this
site2 = href_uri
elsif scheme.nil? # relative
- site2 = URI.join(site, href_uri.path) # HACK
+ if a_href.start_with? '//' # protocol-relative
+ href_uri.scheme = uri.scheme # copy the parent scheme
+ site2 = href_uri
+ else # assume site-relative
+ site2 = URI.join(site, href_uri.path) # HACK
+ end
else # something else
site2 = nil
end