]> git.ipfire.org Git - thirdparty/curl.git/commit
urlapi: detect scheme better when not guessing
authorDaniel Stenberg <daniel@haxx.se>
Wed, 14 Sep 2022 07:18:30 +0000 (09:18 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 15 Sep 2022 07:31:40 +0000 (09:31 +0200)
commit846678541b8186f0fdaaab927dffebdbad52b6de
treeea36723bdfdea021f918ac6ea2d55dd8151bf287
parent7f5fe74323e2d63371c2b2f936ee2c630d1042c0
urlapi: detect scheme better when not guessing

When the parser is not allowed to guess scheme, it should consider the
word ending at the first colon to be the scheme, independently of number
of slashes.

The parser now checks that the scheme is known before it counts slashes,
to improve the error messge for URLs with unknown schemes and maybe no
slashes.

When following redirects, no scheme guessing is allowed and therefore
this change effectively prevents redirects to unknown schemes such as
"data".

Fixes #9503
lib/transfer.c
lib/url.c
lib/urlapi-int.h
lib/urlapi.c