git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: clone from url with email address as username?(escaping @ symbol)

From
Daniel Stenberg <daniel@haxx.se>
Date
Sep 29, 2009, 20:38 UTC
Message-ID
<alpine.DEB.2.00.0909292228120.23903@tvnag.unkk.fr>
In-Reply-To
<vpqws3hpqr1.fsf@bauges.imag.fr>
On Tue, 29 Sep 2009, Matthieu Moy wrote:
>> Exactly. So curl is not "wrong", it just can't work around this user-error.
>
> It may not want work around user-errors, but you can hardly say that
> it _can't_.

It can't work around this error. In theory we could make it GUESS that one of the @-letters are actually supposed to be %40, but I won't. It could also guess that @ was accidentally a '2' with alt-gr pressed when using a nordic keyboard layout. Guessing here is crazy.

> Many tools do in this case, Firefox is one of them.
So what if you had that @ in your password and not in your user name?
> And anyway, trying to connect to email.com@server.com is probably the worst 
> thing it can do.

I understand that you're saying that as a git user and someone who's not into curl and libcurl details, but I'm in the opposite corner mostly and I claim that isn't at all such a bad outcome from that input. curl has that approach through-out its entire URL parser. It gets what it needs and then uses the rest unparsed. That way it is very liberal in what it accepts and it doesn't reject bad URLs as long as it only can extract the parts it needs.

If curl had a strict parser it would of course bluntly reject that URL at once.

> At least, it could warn about two @ in the URL and say it can't handle it

It could, sure. But curl has no such strict parser so it accepts all sorts of various violations.

I don't think this is the proper place to discuss what curl (or libcurl) should or shouldn't do with given URLs - but you're most welcome to bring your ideas and patches to the curl project and we can debate their virtues over there.

-- 
  / daniel.haxx.se
Previous: Matthieu MoyNext: Matthieu Moy
Message 10 of 15 in “clone from url with email address as username?(escaping @ symbol)”
  1. Ben BennettSep 29, 2009
  2. Sverre RabbelierSep 29, 2009
  3. Matthieu MoySep 29, 2009
  4. Sverre RabbelierSep 29, 2009
  5. Ben BennettSep 29, 2009
  6. Matthieu MoySep 29, 2009
  7. Matthieu MoySep 29, 2009
  8. Daniel StenbergSep 29, 2009
  9. Matthieu MoySep 29, 2009
  10. Daniel StenbergSep 29, 2009
  11. Matthieu MoySep 29, 2009
  12. Ben BennettSep 29, 2009
  13. Matthieu MoySep 29, 2009
  14. Matthieu MoySep 29, 2009
  15. Ben BennettSep 29, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.