help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there something like `file-name-concat', but for urls?


From: tomas
Subject: Re: Is there something like `file-name-concat', but for urls?
Date: Tue, 25 Jul 2023 19:24:54 +0200

On Tue, Jul 25, 2023 at 06:21:49PM +0200, Emanuel Berg wrote:
> Marcin Borkowski wrote:
> 
> > given e.g. "https", "example.com" (or "example.com/") and
> > "page", I want to get "https://example.com/page";. Is there
> > a built-in Elisp function to do that?
> 
> Do it yourself Marcin :) Even more so because you already did
> something like that, with the filename normalizer, I remember!
> 
> If so, you can use the correct URL terminology, which is
> 
> 1. scheme:
> 2. //server
> 3. [:port]
> 4. [/path]
> 5. [/program?q=argument]
> 6. [#fragment]
> 
> See this page,
> 
>   https://dataswamp.org/~incal/distsys/url.html
> 
> BTW thanks for letting me realize I should modernize that, it
> is so old https isn't even included :$

Plus URL encoding. Plus deciding in fringe cases whether encoding
is in order or not (and perhaps avoiding those cases where it would
be in order but there are botched implementations around so better
don't (ISTR there was a security hole where the reverse proxy
charged with securing access had a different idea than the server
behind it). So RFC 3986 plus perhaps RFC 8820 plus a couple plus
"Real Life" (TM).

I mean: it sure is fun, and I've caught myself doing this too, but
some working library with the most egregious botches already fixed
and where new fixes can go to seems to be a good idea, in general :)

That doesn't mean one shouldn't try: you sure understand better
how that lib works once you have.

Cheers
-- 
t

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]