Protocol-relative links being rewritten incorrectly

Support requests, bug reports, etc. go here. Dedicated servers / VDS hosting only
fluffy
Bear Rating Trainee
Bear Rating Trainee
Posts: 37
Joined: 20 Jun 2012, 09:24

Protocol-relative links being rewritten incorrectly

Postby fluffy » 20 Jul 2012, 19:54

This is a pretty uncommon issue but one of the RSS feeds I follow uses protocol-relative links (e.g. a link in the form of //example.com/foo rather than the more common http://example.com/foo) because the guy who runs the site seems to think that saving 5 characters here and there is much important for reducing bandwidth costs than making his articles more concise. He also insists (correctly, if stupidly) that this is a published portion of whatever RFC is responsible for URI schemata, and points out that web browsers themselves have no problem with it.

Of course, he conveniently ignores the fact that some RSS readers might be viewed via https: and that the sites in question might not actually work equivalently from an https: vs. http: URL, and that does violate pretty much everything. He also ignores that RSS feeds are supposed to be portable and not use relative links OF ANY KIND to begin with.

Regardless of that, and realizing that this is a stupid niche request that only exists for what appears to be only this one stupid site on the whole stupid Internet, would it be possible for tt-rss to rewrite protocol-relative links correctly?

User avatar
markwaters
Bear Rating Trainee
Bear Rating Trainee
Posts: 32
Joined: 20 May 2008, 13:10
Location: France
Contact:

Re: Protocol-relative links being rewritten incorrectly

Postby markwaters » 20 Jul 2012, 22:47

You might want to have a look at http://www.privoxy.org/
This proxy server has the ability to rewrite URLs and so could reassemble the 'damaged' links.
It also does a lot of other useful stuff.
Good Luck
Mark

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Protocol-relative links being rewritten incorrectly

Postby fox » 21 Jul 2012, 23:06

Unless there's a patch involved I don't see this happening, sorry. :(

fluffy
Bear Rating Trainee
Bear Rating Trainee
Posts: 37
Joined: 20 Jun 2012, 09:24

Re: Protocol-relative links being rewritten incorrectly

Postby fluffy » 21 Jul 2012, 23:33

Where does URL rewriting take place? I'd be more than happy to take this on myself - it seems like it should be a pretty trivial thing to fix.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Protocol-relative links being rewritten incorrectly

Postby fox » 22 Jul 2012, 19:24

rewrite_relative_url(), I think.

fluffy
Bear Rating Trainee
Bear Rating Trainee
Posts: 37
Joined: 20 Jun 2012, 09:24

Re: Protocol-relative links being rewritten incorrectly

Postby fluffy » 22 Jul 2012, 20:32

That was easy! Pull request submitted.


Return to “Support”

Who is online

Users browsing this forum: No registered users and 7 guests